File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ $(function () {
16
16
return all_lines ;
17
17
}
18
18
19
+ var hashLines = / ^ # L ( \d + (?: - \d + ) ? (?: , \d + (?: - \d + ) ? ) * ) $ / ;
20
+
19
21
// Allow tilde in url (#1118). Orig: /\w+:\/\/[\w-.\/?%&=:@;#]*/g,
20
22
SyntaxHighlighter . regexLib [ 'url' ] = / \w + : \/ \/ [ \w - . \/ ? % & = : @ ; # ~ ] * / g;
21
23
@@ -66,7 +68,7 @@ $(function () {
66
68
if ( source . html ( ) . length > 500000 ) {
67
69
source . children ( 'code' ) . removeClass ( ) ;
68
70
}
69
- else if ( lineMatch = document . location . hash . match ( / ^ # L ( \d + ( - \d + ) ? ( , \d + ( - \d + ) ? ) * ) $ / ) ) {
71
+ else if ( lineMatch = document . location . hash . match ( hashLines ) ) {
70
72
source . attr ( 'data-line' , lineMatch [ 1 ] ) ;
71
73
}
72
74
// check for 'P{encoded_package_name}' anchor, convert to
@@ -175,7 +177,7 @@ $(function () {
175
177
176
178
$ ( window ) . on ( 'hashchange' , function ( ) {
177
179
var lineMatch ;
178
- if ( lineMatch = document . location . hash . match ( / ^ # L ( \d + ( - \d + ) ? ( , \d + ( - \d + ) ? ) * ) $ / ) ) {
180
+ if ( lineMatch = document . location . hash . match ( hashLines ) ) {
179
181
source . attr ( 'data-line' , lineMatch [ 1 ] ) ;
180
182
var selector = $ . map (
181
183
parseLines ( lineMatch [ 1 ] ) ,
You can’t perform that action at this time.
0 commit comments