From 545da6113ce90ab81fe7cf8c80f942b2e98c4eaf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 4 May 2019 13:35:08 -0700 Subject: HTML writer: don't add variation selector if it's already there. See f11d0c9dc8b61cc38e138aaecb0f0094add3465a This fixes round-trip failures. --- src/Text/Pandoc/Writers/HTML.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 3cd9a0892..2c386b465 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -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 -- cgit v1.2.3