File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,24 @@ Repaginator.prototype = {
244244 }
245245 }
246246
247+ // Fourth: See if there is rel=next or rel=prev
248+ let rel = ( el . getAttribute ( "rel" ) || "" ) . trim ( ) ;
249+ if ( rel && ( rel . contains ( "next" ) || rel . contains ( "prev" ) ) ) {
250+ this . query += "//a[@rel='" + escapeXStr ( rel ) + "']" ;
251+ // no point in checking for numbers
252+ this . attemptToIncrement = false ;
253+ log ( LOG_DEBUG , "using a[@rel]" ) ;
254+ return ;
255+ }
256+
257+ // Fifth: See if there is a class we may use
258+ if ( el . className ) {
259+ this . query += "//a[@class='" + escapeXStr ( el . className ) + "']" ;
260+ this . numberToken = / ( \[ @ c l a s s = ' .* ?) ( \d + ) ( .* ?' \] ) / ;
261+ log ( LOG_DEBUG , "using a[@class]" ) ;
262+ return ;
263+ }
264+
247265 throw new Error ( "No anchor expression found!" ) ;
248266 } ) . call ( this ) ;
249267 } ) . call ( this ) ;
You can’t perform that action at this time.
0 commit comments