mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
Allow "section/" links pointing to "section/index"
This commit is contained in:
parent
297c9b5b89
commit
2380943106
2 changed files with 4 additions and 2 deletions
|
|
@ -119,6 +119,9 @@ describe('ngdoc', function(){
|
|||
expect(doc.convertUrlToAbsolute('angular.widget')).toEqual('section/angular.widget');
|
||||
});
|
||||
|
||||
it('should change id to index if not specified', function() {
|
||||
expect(doc.convertUrlToAbsolute('guide/')).toEqual('guide/index');
|
||||
});
|
||||
});
|
||||
|
||||
describe('sorting', function(){
|
||||
|
|
|
|||
|
|
@ -72,9 +72,8 @@ Doc.prototype = {
|
|||
* @returns {string} Absolute url
|
||||
*/
|
||||
convertUrlToAbsolute: function(url) {
|
||||
if (url.substr(-1) == '/') return url + 'index';
|
||||
if (url.match(/\//)) return url;
|
||||
|
||||
// remove this after
|
||||
return this.section + '/' + url;
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue