diff options
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index 2a8835263..3cd9a0892 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -108,11 +108,20 @@ defaultWriterState = WriterState {stNotes= [], stMath = False, stQuotes = False, strToHtml :: String -> Html strToHtml ('\'':xs) = preEscapedString "\'" `mappend` strToHtml xs strToHtml ('"' :xs) = preEscapedString "\"" `mappend` strToHtml xs -strToHtml xs@(_:_) = case break (\c -> c == '\'' || c == '"') xs of +strToHtml (x:xs) | needsVariationSelector x + = preEscapedString [x, '\xFE0E'] `mappend` strToHtml xs +strToHtml xs@(_:_) = case break (\c -> c == '\'' || c == '"' || + needsVariationSelector c) xs of (_ ,[]) -> toHtml xs (ys,zs) -> toHtml ys `mappend` strToHtml zs strToHtml [] = "" +-- See #5469: this prevents iOS from substituting emojis. +needsVariationSelector :: Char -> Bool +needsVariationSelector '↩' = True +needsVariationSelector '↔' = True +needsVariationSelector _ = False + -- | Hard linebreak. nl :: WriterOptions -> Html nl opts = if writerWrapText opts == WrapNone |