Although I'm using your library for non standard tag parsing, I noticed something:
HTML::get_attribute will fail if the tag string has letters from attr in it.
A simple fix is to search for the first space before trying to find the attribute. Patch attached.
I can foresee other instances though where the attribute being looked for might be a substring of another attribute name. A find for [space]attribute[equals] might be better and save work. Patch attached.
patches
2nd variation
let me know if you see a reason why either of those would be bad- eg specification somewhere, or if you decide to commit them.
Thanks for your great work!
I am not sure I understand the patch. Can you add a concrete case where the existing code fails?
It has been quite some time, but I seem to recall it being a situation where since you're only moving forward by one character after finding an attribute, it would catch up on multiple hits within the same find given certain strings.
It has just been so long- there could certainly be problems with the patch-- I don't even remember what function that was in! :)