cgrand/enlive — pull request #47 by smuehlst (2012-11-03 19:58:26+00:00)
Title: Fixed bug: Using the attr|= selector failed if the value of the attribute was equal to the test value

Hello Christophe,

I recently played with enlive. I believe I found a bug, and hopefully I fixed it.

I used the "attr|=" selector, and it failed with an "java.lang.StringIndexOutOfBoundsException: String index out of range" if the value of the tested attribute was equal to the comparison value.

The W3C documentation says about the "attr|=" selector:

'Represents an element with the att attribute, its value either being exactly "val" or beginning with "val" immediately followed by "-" (U+002D).'

Please review the test case and the fix, and merge it if it is appropriate.

Best Regards
Stephan Mühlstrasser