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

Commit

Permalink
fix(docs): correctly generate filenames for plunkr/fiddle
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
IgorMinar committed Oct 31, 2012
1 parent 7c67b2f commit 090e542
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/src/templates/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) {
function read(text) {
var files = [];
angular.forEach(text ? text.split(' ') : [], function(refId) {
files.push({name: refId.split('-')[0], content: getEmbeddedTemplate(refId)});
// refId is index.html-343, so we need to strip the unique ID when exporting the name
files.push({name: refId.replace(/-\d+$/, ''), content: getEmbeddedTemplate(refId)});
});
return files;
}
Expand Down

0 comments on commit 090e542

Please sign in to comment.