Allow "section/" links pointing to "section/index"

This commit is contained in:
Vojta Jina 2011-05-19 21:14:41 +02:00 committed by Igor Minar
parent 297c9b5b89
commit 2380943106
2 changed files with 4 additions and 2 deletions

View file

@ -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(){

View file

@ -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;
},