git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: don't add variation selector if it's already there.

See f11d0c9dc8b61cc38e138aaecb0f0094add3465a This fixes round-trip failures.

commit545da6113ce90ab81fe7cf8c80f942b2e98c4eaf authorJohn MacFarlane <jgm@berkeley.edu> dateSat 4 May 2019, 13:35 (8 years ago) parentfee3258
1 file changed+4−1
src/Text/Pandoc/Writers/HTML.hs+4−1
src/Text/Pandoc/Writers/HTML.hs+4−1
@@ -109,7 +109,10 @@ strToHtml :: String -> Html
109109strToHtml ('\'':xs) = preEscapedString "\'" `mappend` strToHtml xs
110110strToHtml ('"' :xs) = preEscapedString "\"" `mappend` strToHtml xs
111111strToHtml (x:xs) | needsVariationSelector x
112− = preEscapedString [x, '\xFE0E'] `mappend` strToHtml xs
112+ = preEscapedString [x, '\xFE0E'] `mappend`
113+ case xs of
114+ ('\xFE0E':ys) -> strToHtml ys
115+ _ -> strToHtml xs
113116strToHtml xs@(_:_) = case break (\c -> c == '\'' || c == '"' ||
114117 needsVariationSelector c) xs of
115118 (_ ,[]) -> toHtml xs