mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-10 15:54:42 +00:00
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.
This commit is contained in:
parent
295af335c1
commit
bb52c4e8d3
1 changed files with 2 additions and 1 deletions
|
|
@ -63,7 +63,8 @@ docsApp.directive.sourceEdit = function(getEmbeddedTemplate) {
|
||||||
function read(text) {
|
function read(text) {
|
||||||
var files = [];
|
var files = [];
|
||||||
angular.forEach(text ? text.split(' ') : [], function(refId) {
|
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;
|
return files;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue