You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was surprised to discover that the escapeXml function escapes double quotes (") but not single quotes ('). Digging into the source code of tagsoup, I found this comment:
--| A table mapping XML entity names to resolved strings. All strings are a single character long.
-- Does /not/ include @apos@ as Internet Explorer does not know about it.
xmlEntities:: [(String, String)]
xmlEntities =let a*b = (a,[b]) in
["quot"*'"'
,"amp"*'&'
-- ,"apos" * '\'' -- Internet Explorer does not know that
,"lt"*'<'
,"gt"*'>'
]
This suggests that the reason that single quotes aren't escaped is due to Internet Explorer not supporting '. But this feels a bit too conservative, since Internet Explorer does support ', as suggested here. (Credit goes to this stache pull request for that idea.)
Would you be open to escapeXml escaping single quotes as ' instead?
The text was updated successfully, but these errors were encountered:
RyanGlScott
changed the title
Escape single quote (') characters as '
Escape single quote (') characters as '
Sep 15, 2018
Having Google'd, there doesn't seem to be a consistent set... Quite a lot do &<>, some more do &<>", others do &<>"' and some add / in there for reasons I can't fathom. I think you're right, I'd happily take a patch to make it escape ' to the numeric variant.
I was surprised to discover that the
escapeXml
function escapes double quotes ("
) but not single quotes ('
). Digging into the source code oftagsoup
, I found this comment:tagsoup/src/Text/HTML/TagSoup/Entity.hs
Lines 73 to 82 in 99a43e9
This suggests that the reason that single quotes aren't escaped is due to Internet Explorer not supporting
'
. But this feels a bit too conservative, since Internet Explorer does support'
, as suggested here. (Credit goes to thisstache
pull request for that idea.)Would you be open to
escapeXml
escaping single quotes as'
instead?The text was updated successfully, but these errors were encountered: