File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -547,10 +547,22 @@ Doc.prototype = {
547547 self = this ,
548548 minerrMsg ;
549549
550+ var gitTagFromFullVersion = function ( version ) {
551+ var match = version . match ( / - ( \w { 7 } ) / ) ;
552+
553+ if ( match ) {
554+ // git sha
555+ return match [ 1 ] ;
556+ }
557+
558+ // git tag
559+ return 'v' + version ;
560+ } ;
561+
550562 if ( this . section === 'api' ) {
551563 dom . tag ( 'a' , {
552- href : 'http://github.com/angular/angular.js/tree/v ' +
553- gruntUtil . getVersion ( ) . cdn + '/' + self . file + '#L' + self . line ,
564+ href : 'http://github.com/angular/angular.js/tree/' +
565+ gitTagFromFullVersion ( gruntUtil . getVersion ( ) . full ) + '/' + self . file + '#L' + self . line ,
554566 class : 'view-source btn btn-action' } , function ( dom ) {
555567 dom . tag ( 'i' , { class :'icon-zoom-in' } , ' ' ) ;
556568 dom . text ( ' View source' ) ;
You can’t perform that action at this time.
0 commit comments