File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -235,7 +235,7 @@ proto.updateGetPathTemplate = function( optPath ) {
235235 // convert path option into regex to look for pattern in location
236236 // escape query (?) in url, allows for parsing GET parameters
237237 var regexString = optPath
238- . replace ( / (?< ! \\ ) \? / , '\\?' )
238+ . replace ( / (?< ! \\ ) \? / , '\\?' )
239239 . replace ( '{{#}}' , '(\\d\\d?\\d?)' ) ;
240240 var templateRe = new RegExp ( regexString ) ;
241241 var match = location . href . match ( templateRe ) ;
@@ -299,9 +299,17 @@ proto.updateGetAbsolutePath = function() {
299299 }
300300
301301 var pathname = location . pathname ;
302+ // query parameter #829. example.com/?pg=2
303+ var isQuery = path . match ( / ^ \? / ) ;
304+ if ( isQuery ) {
305+ this . getAbsolutePath = function ( ) {
306+ return pathname + this . getPath ( ) ;
307+ } ;
308+ return ;
309+ }
310+
302311 // /foo/bar/index.html => /foo/bar
303312 var directory = pathname . substring ( 0 , pathname . lastIndexOf ( '/' ) ) ;
304-
305313 this . getAbsolutePath = function ( ) {
306314 return directory + '/' + this . getPath ( ) ;
307315 } ;
You canβt perform that action at this time.
0 commit comments