aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-05-04 13:35:08 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-05-04 13:35:44 -0700
commit545da6113ce90ab81fe7cf8c80f942b2e98c4eaf (patch)
tree74d7a5a7528d71cfa42e363aa8d20469b4170fb3 /src/Text/Pandoc/Writers
parentfee3258280959a741fbdddb1eeb4b1ef2ab14e6d (diff)
downloadpandoc-545da6113ce90ab81fe7cf8c80f942b2e98c4eaf.tar.gz
HTML writer: don't add variation selector if it's already there.
See f11d0c9dc8b61cc38e138aaecb0f0094add3465a This fixes round-trip failures.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
1 files changed, 4 insertions, 1 deletions
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