From 85062c47cac44d63b06b97ae86b2a4f596889ad6 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Mon, 14 Nov 2016 04:56:12 -0800 Subject: [PATCH] chore(util.js): getExampleName - support optional .html suffix --- public/resources/js/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/resources/js/util.js b/public/resources/js/util.js index 87ddeed291..91cf6e5a01 100644 --- a/public/resources/js/util.js +++ b/public/resources/js/util.js @@ -77,7 +77,7 @@ var NgIoUtil = (function () { // TODO: use $location.path() instead(?). It seems to be empty. var loc = $location.absUrl(); // E.g., https://example.com/docs/dart/latest/guide/displaying-data.html - var matches = loc.match(/.*\/([\w\.\-]+)\.html/); + var matches = loc.match(/.*\/([\w\-]+)(\.html)?$/); if (matches) NgIoUtil.setExampleName(matches[1]); // cache name } return NgIoUtil._exampleName;