HTML writer: don't add variation selector if it's already there.

See f11d0c9dc8
This fixes round-trip failures.
This commit is contained in:
John MacFarlane 2019-05-04 13:35:08 -07:00
parent fee3258280
commit 545da6113c

View file

@ -109,7 +109,10 @@ strToHtml :: String -> Html
strToHtml ('\'':xs) = preEscapedString "\'" `mappend` strToHtml xs
strToHtml ('"' :xs) = preEscapedString "\"" `mappend` strToHtml xs
strToHtml (x:xs) | needsVariationSelector x
= preEscapedString [x, '\xFE0E'] `mappend` strToHtml xs
= preEscapedString [x, '\xFE0E'] `mappend`
case xs of
('\xFE0E':ys) -> strToHtml ys
_ -> strToHtml xs
strToHtml xs@(_:_) = case break (\c -> c == '\'' || c == '"' ||
needsVariationSelector c) xs of
(_ ,[]) -> toHtml xs