rezakho/ganon

Class selector treats dashes as delimiter

Opened this issue · 1 comments

What will reproduce the problem?
In HTML such as
  <div class="word-other"> ... </div>

$html('.word') will incorrectly return the node above.

What is the expected output? What do you see instead?
That query should not return the .word-other node.

Which version are you using?
Ganon single file PHP5 (rev. #78)

Please provide any additional information below.
I believe the issue is that you are using /\b/ as the regular expression to 
signify class-name boundaries.  However, this is really a word boundary, where 
dashes qualify.

Original issue reported on code.google.com by victor.shih@gmail.com on 4 Sep 2014 at 9:23

You probably want something like /(^| )/ before and /( |$)/ after instead.

Original comment by victor.shih@gmail.com on 4 Sep 2014 at 9:24