File tree 1 file changed +14
-2
lines changed
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -547,10 +547,22 @@ Doc.prototype = {
547
547
self = this ,
548
548
minerrMsg ;
549
549
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
+
550
562
if ( this . section === 'api' ) {
551
563
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 ,
554
566
class : 'view-source btn btn-action' } , function ( dom ) {
555
567
dom . tag ( 'i' , { class :'icon-zoom-in' } , ' ' ) ;
556
568
dom . text ( ' View source' ) ;
You can’t perform that action at this time.
0 commit comments