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
diff --git a/test/command/4235.md b/test/command/4235.md
index e6e321841..8bbf43ff9 100644
--- a/test/command/4235.md
+++ b/test/command/4235.md
@@ -6,7 +6,7 @@ This.^[Has a footnote.]
Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.↩
Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.↩︎
Here’s the long note. This one contains multiple blocks.
Subsequent blocks are indented to show that they belong to the footnote (as with list items).
{ <code> }
-If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.↩
This is easier to type. Inline notes may contain links and ]
verbatim characters, as well as [bracketed text].↩
In quote.↩
In list.↩
If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.↩︎
+This is easier to type. Inline notes may contain links and ]
verbatim characters, as well as [bracketed text].↩︎
In quote.↩︎
In list.↩︎