Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 090e542

Browse files
committed
fix(docs): correctly generate filenames for plunkr/fiddle
previously examples like $http where broken because we would strip part of the filename (http-hello.html -> http) we really want to strip only the id suffix that we append to disambiguate common filenames (like index.html) which appear in many examples.
1 parent 7c67b2f commit 090e542

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/src/templates/js/docs.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) {
6363
function read(text) {
6464
var files = [];
6565
angular.forEach(text ? text.split(' ') : [], function(refId) {
66-
files.push({name: refId.split('-')[0], content: getEmbeddedTemplate(refId)});
66+
// refId is index.html-343, so we need to strip the unique ID when exporting the name
67+
files.push({name: refId.replace(/-\d+$/, ''), content: getEmbeddedTemplate(refId)});
6768
});
6869
return files;
6970
}

0 commit comments

Comments
 (0)