Skip to content

Commit

Permalink
Replace negative lookbehind with a more supported regular expression (#…
Browse files Browse the repository at this point in the history
…837)

* provide fix for bug related to parsing GET parameters

* expand to test for a path that has already escaped the query string

* remove negative lookbehind and replaced with alternative regexp due to firefox incompatibility

* follow code style
  • Loading branch information
kyle-mccarthy authored and desandro committed Oct 12, 2018
1 parent eb58390 commit 9f9ccf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ proto.updateGetPathTemplate = function( optPath ) {
// convert path option into regex to look for pattern in location
// escape query (?) in url, allows for parsing GET parameters
var regexString = optPath
.replace( /(?<!\\)\?/, '\\?' )
.replace( /(\\\?|\?)/, '\\?' )
.replace( '{{#}}', '(\\d\\d?\\d?)' );
var templateRe = new RegExp( regexString );
var match = location.href.match( templateRe );
Expand Down

0 comments on commit 9f9ccf3

Please sign in to comment.