git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: don't add variation selector if it's already there.
545da61John MacFarlane
src/Text/Pandoc/Writers/HTML.hs+4−1
@@ -109,7 +109,10 @@ strToHtml :: String -> Html
109strToHtml ('\'':xs) = preEscapedString "\'" `mappend` strToHtml xs
109strToHtml ('\'':xs) = preEscapedString "\'" `mappend` strToHtml xs
110strToHtml ('"' :xs) = preEscapedString "\"" `mappend` strToHtml xs
110strToHtml ('"' :xs) = preEscapedString "\"" `mappend` strToHtml xs
111strToHtml (x:xs) | needsVariationSelector x
111strToHtml (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
113strToHtml xs@(_:_) = case break (\c -> c == '\'' || c == '"' ||
116strToHtml xs@(_:_) = case break (\c -> c == '\'' || c == '"' ||
114 needsVariationSelector c) xs of
117 needsVariationSelector c) xs of
115 (_ ,[]) -> toHtml xs
118 (_ ,[]) -> toHtml xs