ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
738 stars 134 forks source link

Escape apostrophes in `escapeHTML` #223

Closed cocreature closed 7 years ago

cocreature commented 7 years ago

Without this, searching for things containing apostrophes is broken in the web interface since the markup in the links on the left breaks. Searching for foldl, waiting until the results are loaded and then typing ' can reproduce this problem.

ndmitchell commented 7 years ago

Thanks for the pull request, and spotting the bug. Certainly escapeHTML could escape ', but the problem with ' is that it isn't an XML entity escape as well, which can cause issues if your content types go wrong etc. A more robust solution is to not use attributes with foo='apostrophe', which I've done in the one place it was happening, which also fixes the bug. Thanks a lot!