diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-07-15 16:02:46 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-07-15 16:02:46 -0700 |
commit | af445b34d8ec1a6f60cd6eb7c6964e7de450ae83 (patch) | |
tree | c53ad3de894887a4cb828748d6b34286f5fff99e /src/Text/Pandoc/Writers/CommonMark.hs | |
parent | ec30fb37c12fc5d1a248971831414891cf6dcbe7 (diff) | |
download | pandoc-af445b34d8ec1a6f60cd6eb7c6964e7de450ae83.tar.gz |
Make markdown and github writers respect the `emoji` extension.
Diffstat (limited to 'src/Text/Pandoc/Writers/CommonMark.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/CommonMark.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs index 98c1101fa..27179496c 100644 --- a/src/Text/Pandoc/Writers/CommonMark.hs +++ b/src/Text/Pandoc/Writers/CommonMark.hs @@ -304,6 +304,11 @@ inlineToNodes opts (Math mt str) = (node (HTML_INLINE (T.pack ("\\(" ++ str ++ "\\)"))) [] :) DisplayMath -> (node (HTML_INLINE (T.pack ("\\[" ++ str ++ "\\]"))) [] :) +inlineToNodes opts (Span ("",["emoji"],kvs) [Str s]) = do + case lookup "data-emoji" kvs of + Just emojiname | isEnabled Ext_emoji opts -> + (node (TEXT (":" <> T.pack emojiname <> ":")) [] :) + _ -> (node (TEXT (T.pack s)) [] :) inlineToNodes opts (Span attr ils) = let nodes = inlinesToNodes opts ils op = tagWithAttributes opts True False "span" attr |