egonSchiele / HandsomeSoup

Easy HTML parsing for Haskell
http://egonschiele.github.com/HandsomeSoup
BSD 3-Clause "New" or "Revised" License
124 stars 20 forks source link

Allow arbitrary characters in attribute selectors. #29

Closed michaelsproul closed 9 years ago

michaelsproul commented 9 years ago

I'm parsing some links with ? and & characters in them, but currently HandsomeSoup only allows numbers, letters and some special characters (/-_|~="'.) inside attribute selectors.

From browsing the CSS2 spec and grammar, it seems "anything goes" when it comes to the content of an attribute selector, so I've updated the parser to allow all characters except [ and ].

My editor also trimmed some trailing whitespace, which I'm happy to put back if you like :stuck_out_tongue:.

This change fixes my application but if you can foresee any negatives, let me know!

egonSchiele commented 9 years ago

LGTM, thanks!

michaelsproul commented 9 years ago

Could you publish this update to Hackage? Thanks :smile:

egonSchiele commented 9 years ago

Done!

michaelsproul commented 9 years ago

Thanks!