yanwong / ganon

Automatically exported from code.google.com/p/ganon
0 stars 0 forks source link

Class selector treats dashes as delimiter #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
You probably want something like /(^| )/ before and /( |$)/ after instead.

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