Skip to content
This repository has been archived by the owner on Jan 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #161 from pfrankov/patch-1
Browse files Browse the repository at this point in the history
feat(ngdocs): allow dots in names #87
  • Loading branch information
m7r committed Aug 6, 2015
2 parents f6c5677 + cd0db4c commit 68f97db
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,18 @@ Doc.prototype = {
}
});
flush();
this.shortName = this.name.split(/[\.:#]/).pop().trim();
var shortName = this.name.split("#");
if (shortName.length > 1) {
this.shortName = shortName.pop().trim();
} else {
shortName = this.name.split(":");
if (shortName.length > 1) {
this.shortName = shortName.pop().trim();
} else {
this.shortName = this.name.split(".").pop().trim();
}
}

this.id = this.id || // if we have an id just use it
(this.ngdoc === 'error' ? this.name : '') ||
(((this.file||'').match(/.*(\/|\\)([^(\/|\\)]*)\.ngdoc/)||{})[2]) || // try to extract it from file name
Expand Down

0 comments on commit 68f97db

Please sign in to comment.