git.iko.soy/typeable/pandoc
on master help sign in
Added `emoji` extension to Markdown.

This is enabled by default in `markdown_github`. Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options` (API change). Closes #2523.

commit0a6aaf5e1b60031b175ff81fa61f5059d63a75d8 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 13 Nov 2015, 12:06 (11 years ago) parentd8080db
7 files changed+938−1
README+5−1 changelog+4 pandoc.cabal+1 src/Text/Pandoc/Emoji.hs+905 src/Text/Pandoc/Options.hs+2 src/Text/Pandoc/Readers/Markdown.hs+17 tests/Tests/Readers/Markdown.hs+4
README+5−1
@@ -3146,6 +3146,10 @@ treated as spaces or as hard line breaks. This option is intended for
31463146use with East Asian languages where spaces are not used between words,
31473147but text is divided into lines for readability.
31483148
3149+#### Extension: `emoji` ####
3150+
3151+Parses textual emojis like `:smile:` as Unicode emoticons.
3152+
31493153#### Extension: `tex_math_single_backslash` ####
31503154
31513155Causes anything between `\(` and `\)` to be interpreted as inline
@@ -3256,7 +3260,7 @@ variants are supported:
32563260: `pipe_tables`, `raw_html`, `tex_math_single_backslash`,
32573261 `fenced_code_blocks`, `auto_identifiers`,
32583262 `ascii_identifiers`, `backtick_code_blocks`, `autolink_bare_uris`,
3259− `intraword_underscores`, `strikeout`, `hard_line_breaks`,
3263+ `intraword_underscores`, `strikeout`, `hard_line_breaks`, `emoji`,
32603264 `shortcut_reference_links`.
32613265
32623266`markdown_mmd` (MultiMarkdown)
changelog+4
@@ -5,6 +5,10 @@ pandoc (1.15.2)
55
66 * Fixed omitted `url(...)` in CSS data-uri with `--self-contained` (#2489).
77
8+ * Added `emoji` Markdown extension, enabled by default in `markdown_github`
9+ (#2523). Added `Ext_emoji` to `Extension` in `Text.Pandoc.Options`
10+ (API change).
11+
812 * `Text.Pandoc.Readers.HTML.parseTags`: Fixed over-eager raw HTML inline
913 parsing (#2469). Tightened up the inline HTML parser so it disallows
1014 TagWarnings.
pandoc.cabal+1
@@ -391,6 +391,7 @@ Library
391391 Text.Pandoc.Writers.Shared,
392392 Text.Pandoc.Asciify,
393393 Text.Pandoc.MIME,
394+ Text.Pandoc.Emoji,
394395 Text.Pandoc.Parsing,
395396 Text.Pandoc.UUID,
396397 Text.Pandoc.ImageSize,
src/Text/Pandoc/Emoji.hsnew file+905
@@ -0,0 +1,905 @@
1+{-
2+Copyright (C) 2015 John MacFarlane <jgm@berkeley.edu>
3+
4+This program is free software; you can redistribute it and/or modify
5+it under the terms of the GNU General Public License as published by
6+the Free Software Foundation; either version 2 of the License, or
7+(at your option) any later version.
8+
9+This program is distributed in the hope that it will be useful,
10+but WITHOUT ANY WARRANTY; without even the implied warranty of
11+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+GNU General Public License for more details.
13+
14+You should have received a copy of the GNU General Public License
15+along with this program; if not, write to the Free Software
16+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17+-}
18+
19+{- |
20+ Module : Text.Pandoc.Emoji
21+ Copyright : Copyright (C) 2015 John MacFarlane
22+ License : GNU GPL, version 2 or above
23+
24+ Maintainer : John MacFarlane <jgm@berkeley.edu>
25+ Stability : alpha
26+ Portability : portable
27+
28+Emoji symbol lookup from canonical string identifier.
29+-}
30+module Text.Pandoc.Emoji ( emojis ) where
31+import qualified Data.Map as M
32+
33+emojis :: M.Map String String
34+emojis = M.fromList
35+ [ ("100", "💯")
36+ , ("1234", "🔢")
37+ , ("smile", "😄")
38+ , ("smiley", "😃")
39+ , ("grinning", "😀")
40+ , ("blush", "😊")
41+ , ("relaxed", "☺️")
42+ , ("wink", "😉")
43+ , ("heart_eyes", "😍")
44+ , ("kissing_heart", "😘")
45+ , ("kissing_closed_eyes", "😚")
46+ , ("kissing", "😗")
47+ , ("kissing_smiling_eyes", "😙")
48+ , ("stuck_out_tongue_winking_eye", "😜")
49+ , ("stuck_out_tongue_closed_eyes", "😝")
50+ , ("stuck_out_tongue", "😛")
51+ , ("flushed", "😳")
52+ , ("grin", "😁")
53+ , ("pensive", "😔")
54+ , ("relieved", "😌")
55+ , ("unamused", "😒")
56+ , ("disappointed", "😞")
57+ , ("persevere", "😣")
58+ , ("cry", "😢")
59+ , ("joy", "😂")
60+ , ("sob", "😭")
61+ , ("sleepy", "😪")
62+ , ("disappointed_relieved", "😥")
63+ , ("cold_sweat", "😰")
64+ , ("sweat_smile", "😅")
65+ , ("sweat", "😓")
66+ , ("weary", "😩")
67+ , ("tired_face", "😫")
68+ , ("fearful", "😨")
69+ , ("scream", "😱")
70+ , ("angry", "😠")
71+ , ("rage", "😡")
72+ , ("triumph", "😤")
73+ , ("confounded", "😖")
74+ , ("laughing", "😆")
75+ , ("satisfied", "😆")
76+ , ("yum", "😋")
77+ , ("mask", "😷")
78+ , ("sunglasses", "😎")
79+ , ("sleeping", "😴")
80+ , ("dizzy_face", "😵")
81+ , ("astonished", "😲")
82+ , ("worried", "😟")
83+ , ("frowning", "😦")
84+ , ("anguished", "😧")
85+ , ("smiling_imp", "😈")
86+ , ("imp", "👿")
87+ , ("open_mouth", "😮")
88+ , ("grimacing", "😬")
89+ , ("neutral_face", "😐")
90+ , ("confused", "😕")
91+ , ("hushed", "😯")
92+ , ("no_mouth", "😶")
93+ , ("innocent", "😇")
94+ , ("smirk", "😏")
95+ , ("expressionless", "😑")
96+ , ("man_with_gua_pi_mao", "👲")
97+ , ("man_with_turban", "👳")
98+ , ("cop", "👮")
99+ , ("construction_worker", "👷")
100+ , ("guardsman", "💂")
101+ , ("baby", "👶")
102+ , ("boy", "👦")
103+ , ("girl", "👧")
104+ , ("man", "👨")
105+ , ("woman", "👩")
106+ , ("older_man", "👴")
107+ , ("older_woman", "👵")
108+ , ("person_with_blond_hair", "👱")
109+ , ("angel", "👼")
110+ , ("princess", "👸")
111+ , ("smiley_cat", "😺")
112+ , ("smile_cat", "😸")
113+ , ("heart_eyes_cat", "😻")
114+ , ("kissing_cat", "😽")
115+ , ("smirk_cat", "😼")
116+ , ("scream_cat", "🙀")
117+ , ("crying_cat_face", "😿")
118+ , ("joy_cat", "😹")
119+ , ("pouting_cat", "😾")
120+ , ("japanese_ogre", "👹")
121+ , ("japanese_goblin", "👺")
122+ , ("see_no_evil", "🙈")
123+ , ("hear_no_evil", "🙉")
124+ , ("speak_no_evil", "🙊")
125+ , ("skull", "💀")
126+ , ("alien", "👽")
127+ , ("hankey", "💩")
128+ , ("poop", "💩")
129+ , ("shit", "💩")
130+ , ("fire", "🔥")
131+ , ("sparkles", "✨")
132+ , ("star2", "🌟")
133+ , ("dizzy", "💫")
134+ , ("boom", "💥")
135+ , ("collision", "💥")
136+ , ("anger", "💢")
137+ , ("sweat_drops", "💦")
138+ , ("droplet", "💧")
139+ , ("zzz", "💤")
140+ , ("dash", "💨")
141+ , ("ear", "👂")
142+ , ("eyes", "👀")
143+ , ("nose", "👃")
144+ , ("tongue", "👅")
145+ , ("lips", "👄")
146+ , ("+1", "👍")
147+ , ("thumbsup", "👍")
148+ , ("-1", "👎")
149+ , ("thumbsdown", "👎")
150+ , ("ok_hand", "👌")
151+ , ("facepunch", "👊")
152+ , ("punch", "👊")
153+ , ("fist", "✊")
154+ , ("v", "✌️")
155+ , ("wave", "👋")
156+ , ("hand", "✋")
157+ , ("raised_hand", "✋")
158+ , ("open_hands", "👐")
159+ , ("point_up_2", "👆")
160+ , ("point_down", "👇")
161+ , ("point_right", "👉")
162+ , ("point_left", "👈")
163+ , ("raised_hands", "🙌")
164+ , ("pray", "🙏")
165+ , ("point_up", "☝️")
166+ , ("clap", "👏")
167+ , ("muscle", "💪")
168+ , ("walking", "🚶")
169+ , ("runner", "🏃")
170+ , ("running", "🏃")
171+ , ("dancer", "💃")
172+ , ("couple", "👫")
173+ , ("family", "👪")
174+ , ("two_men_holding_hands", "👬")
175+ , ("two_women_holding_hands", "👭")
176+ , ("couplekiss", "💏")
177+ , ("couple_with_heart", "💑")
178+ , ("dancers", "👯")
179+ , ("ok_woman", "🙆")
180+ , ("no_good", "🙅")
181+ , ("information_desk_person", "💁")
182+ , ("raising_hand", "🙋")
183+ , ("massage", "💆")
184+ , ("haircut", "💇")
185+ , ("nail_care", "💅")
186+ , ("bride_with_veil", "👰")
187+ , ("person_with_pouting_face", "🙎")
188+ , ("person_frowning", "🙍")
189+ , ("bow", "🙇")
190+ , ("tophat", "🎩")
191+ , ("crown", "👑")
192+ , ("womans_hat", "👒")
193+ , ("athletic_shoe", "👟")
194+ , ("mans_shoe", "👞")
195+ , ("shoe", "👞")
196+ , ("sandal", "👡")
197+ , ("high_heel", "👠")
198+ , ("boot", "👢")
199+ , ("shirt", "👕")
200+ , ("tshirt", "👕")
201+ , ("necktie", "👔")
202+ , ("womans_clothes", "👚")
203+ , ("dress", "👗")
204+ , ("running_shirt_with_sash", "🎽")
205+ , ("jeans", "👖")
206+ , ("kimono", "👘")
207+ , ("bikini", "👙")
208+ , ("briefcase", "💼")
209+ , ("handbag", "👜")
210+ , ("pouch", "👝")
211+ , ("purse", "👛")
212+ , ("eyeglasses", "👓")
213+ , ("ribbon", "🎀")
214+ , ("closed_umbrella", "🌂")
215+ , ("lipstick", "💄")
216+ , ("yellow_heart", "💛")
217+ , ("blue_heart", "💙")
218+ , ("purple_heart", "💜")
219+ , ("green_heart", "💚")
220+ , ("heart", "❤️")
221+ , ("broken_heart", "💔")
222+ , ("heartpulse", "💗")
223+ , ("heartbeat", "💓")
224+ , ("two_hearts", "💕")
225+ , ("sparkling_heart", "💖")
226+ , ("revolving_hearts", "💞")
227+ , ("cupid", "💘")
228+ , ("love_letter", "💌")
229+ , ("kiss", "💋")
230+ , ("ring", "💍")
231+ , ("gem", "💎")
232+ , ("bust_in_silhouette", "👤")
233+ , ("busts_in_silhouette", "👥")
234+ , ("speech_balloon", "💬")
235+ , ("footprints", "👣")
236+ , ("thought_balloon", "💭")
237+ , ("dog", "🐶")
238+ , ("wolf", "🐺")
239+ , ("cat", "🐱")
240+ , ("mouse", "🐭")
241+ , ("hamster", "🐹")
242+ , ("rabbit", "🐰")
243+ , ("frog", "🐸")
244+ , ("tiger", "🐯")
245+ , ("koala", "🐨")
246+ , ("bear", "🐻")
247+ , ("pig", "🐷")
248+ , ("pig_nose", "🐽")
249+ , ("cow", "🐮")
250+ , ("boar", "🐗")
251+ , ("monkey_face", "🐵")
252+ , ("monkey", "🐒")
253+ , ("horse", "🐴")
254+ , ("sheep", "🐑")
255+ , ("elephant", "🐘")
256+ , ("panda_face", "🐼")
257+ , ("penguin", "🐧")
258+ , ("bird", "🐦")
259+ , ("baby_chick", "🐤")
260+ , ("hatched_chick", "🐥")
261+ , ("hatching_chick", "🐣")
262+ , ("chicken", "🐔")
263+ , ("snake", "🐍")
264+ , ("turtle", "🐢")
265+ , ("bug", "🐛")
266+ , ("bee", "🐝")
267+ , ("honeybee", "🐝")
268+ , ("ant", "🐜")
269+ , ("beetle", "🐞")
270+ , ("snail", "🐌")
271+ , ("octopus", "🐙")
272+ , ("shell", "🐚")
273+ , ("tropical_fish", "🐠")
274+ , ("fish", "🐟")
275+ , ("dolphin", "🐬")
276+ , ("flipper", "🐬")
277+ , ("whale", "🐳")
278+ , ("whale2", "🐋")
279+ , ("cow2", "🐄")
280+ , ("ram", "🐏")
281+ , ("rat", "🐀")
282+ , ("water_buffalo", "🐃")
283+ , ("tiger2", "🐅")
284+ , ("rabbit2", "🐇")
285+ , ("dragon", "🐉")
286+ , ("racehorse", "🐎")
287+ , ("goat", "🐐")
288+ , ("rooster", "🐓")
289+ , ("dog2", "🐕")
290+ , ("pig2", "🐖")
291+ , ("mouse2", "🐁")
292+ , ("ox", "🐂")
293+ , ("dragon_face", "🐲")
294+ , ("blowfish", "🐡")
295+ , ("crocodile", "🐊")
296+ , ("camel", "🐫")
297+ , ("dromedary_camel", "🐪")
298+ , ("leopard", "🐆")
299+ , ("cat2", "🐈")
300+ , ("poodle", "🐩")
301+ , ("feet", "🐾")
302+ , ("paw_prints", "🐾")
303+ , ("bouquet", "💐")
304+ , ("cherry_blossom", "🌸")
305+ , ("tulip", "🌷")
306+ , ("four_leaf_clover", "🍀")
307+ , ("rose", "🌹")
308+ , ("sunflower", "🌻")
309+ , ("hibiscus", "🌺")
310+ , ("maple_leaf", "🍁")
311+ , ("leaves", "🍃")
312+ , ("fallen_leaf", "🍂")
313+ , ("herb", "🌿")
314+ , ("ear_of_rice", "🌾")
315+ , ("mushroom", "🍄")
316+ , ("cactus", "🌵")
317+ , ("palm_tree", "🌴")
318+ , ("evergreen_tree", "🌲")
319+ , ("deciduous_tree", "🌳")
320+ , ("chestnut", "🌰")
321+ , ("seedling", "🌱")
322+ , ("blossom", "🌼")
323+ , ("globe_with_meridians", "🌐")
324+ , ("sun_with_face", "🌞")
325+ , ("full_moon_with_face", "🌝")
326+ , ("new_moon_with_face", "🌚")
327+ , ("new_moon", "🌑")
328+ , ("waxing_crescent_moon", "🌒")
329+ , ("first_quarter_moon", "🌓")
330+ , ("moon", "🌔")
331+ , ("waxing_gibbous_moon", "🌔")
332+ , ("full_moon", "🌕")
333+ , ("waning_gibbous_moon", "🌖")
334+ , ("last_quarter_moon", "🌗")
335+ , ("waning_crescent_moon", "🌘")
336+ , ("last_quarter_moon_with_face", "🌜")
337+ , ("first_quarter_moon_with_face", "🌛")
338+ , ("crescent_moon", "🌙")
339+ , ("earth_africa", "🌍")
340+ , ("earth_americas", "🌎")
341+ , ("earth_asia", "🌏")
342+ , ("volcano", "🌋")
343+ , ("milky_way", "🌌")
344+ , ("stars", "🌠")
345+ , ("star", "⭐")
346+ , ("sunny", "☀️")
347+ , ("partly_sunny", "⛅")
348+ , ("cloud", "☁️")
349+ , ("zap", "⚡")
350+ , ("umbrella", "☔")
351+ , ("snowflake", "❄️")
352+ , ("snowman", "⛄")
353+ , ("cyclone", "🌀")
354+ , ("foggy", "🌁")
355+ , ("rainbow", "🌈")
356+ , ("ocean", "🌊")
357+ , ("bamboo", "🎍")
358+ , ("gift_heart", "💝")
359+ , ("dolls", "🎎")
360+ , ("school_satchel", "🎒")
361+ , ("mortar_board", "🎓")
362+ , ("flags", "🎏")
363+ , ("fireworks", "🎆")
364+ , ("sparkler", "🎇")
365+ , ("wind_chime", "🎐")
366+ , ("rice_scene", "🎑")
367+ , ("jack_o_lantern", "🎃")
368+ , ("ghost", "👻")
369+ , ("santa", "🎅")
370+ , ("christmas_tree", "🎄")
371+ , ("gift", "🎁")
372+ , ("tanabata_tree", "🎋")
373+ , ("tada", "🎉")
374+ , ("confetti_ball", "🎊")
375+ , ("balloon", "🎈")
376+ , ("crossed_flags", "🎌")
377+ , ("crystal_ball", "🔮")
378+ , ("movie_camera", "🎥")
379+ , ("camera", "📷")
380+ , ("video_camera", "📹")
381+ , ("vhs", "📼")
382+ , ("cd", "💿")
383+ , ("dvd", "📀")
384+ , ("minidisc", "💽")
385+ , ("floppy_disk", "💾")
386+ , ("computer", "💻")
387+ , ("iphone", "📱")
388+ , ("phone", "☎️")
389+ , ("telephone", "☎️")
390+ , ("telephone_receiver", "📞")
391+ , ("pager", "📟")
392+ , ("fax", "📠")
393+ , ("satellite", "📡")
394+ , ("tv", "📺")
395+ , ("radio", "📻")
396+ , ("loud_sound", "🔊")
397+ , ("sound", "🔉")
398+ , ("speaker", "🔈")
399+ , ("mute", "🔇")
400+ , ("bell", "🔔")
401+ , ("no_bell", "🔕")
402+ , ("loudspeaker", "📢")
403+ , ("mega", "📣")
404+ , ("hourglass_flowing_sand", "⏳")
405+ , ("hourglass", "⌛")
406+ , ("alarm_clock", "⏰")
407+ , ("watch", "⌚")
408+ , ("unlock", "🔓")
409+ , ("lock", "🔒")
410+ , ("lock_with_ink_pen", "🔏")
411+ , ("closed_lock_with_key", "🔐")
412+ , ("key", "🔑")
413+ , ("mag_right", "🔎")
414+ , ("bulb", "💡")
415+ , ("flashlight", "🔦")
416+ , ("high_brightness", "🔆")
417+ , ("low_brightness", "🔅")
418+ , ("electric_plug", "🔌")
419+ , ("battery", "🔋")
420+ , ("mag", "🔍")
421+ , ("bathtub", "🛁")
422+ , ("bath", "🛀")
423+ , ("shower", "🚿")
424+ , ("toilet", "🚽")
425+ , ("wrench", "🔧")
426+ , ("nut_and_bolt", "🔩")
427+ , ("hammer", "🔨")
428+ , ("door", "🚪")
429+ , ("smoking", "🚬")
430+ , ("bomb", "💣")
431+ , ("gun", "🔫")
432+ , ("hocho", "🔪")
433+ , ("knife", "🔪")
434+ , ("pill", "💊")
435+ , ("syringe", "💉")
436+ , ("moneybag", "💰")
437+ , ("yen", "💴")
438+ , ("dollar", "💵")
439+ , ("pound", "💷")
440+ , ("euro", "💶")
441+ , ("credit_card", "💳")
442+ , ("money_with_wings", "💸")
443+ , ("calling", "📲")
444+ , ("e-mail", "📧")
445+ , ("inbox_tray", "📥")
446+ , ("outbox_tray", "📤")
447+ , ("email", "✉️")
448+ , ("envelope", "✉️")
449+ , ("envelope_with_arrow", "📩")
450+ , ("incoming_envelope", "📨")
451+ , ("postal_horn", "📯")
452+ , ("mailbox", "📫")
453+ , ("mailbox_closed", "📪")
454+ , ("mailbox_with_mail", "📬")
455+ , ("mailbox_with_no_mail", "📭")
456+ , ("postbox", "📮")
457+ , ("package", "📦")
458+ , ("memo", "📝")
459+ , ("pencil", "📝")
460+ , ("page_facing_up", "📄")
461+ , ("page_with_curl", "📃")
462+ , ("bookmark_tabs", "📑")
463+ , ("bar_chart", "📊")
464+ , ("chart_with_upwards_trend", "📈")
465+ , ("chart_with_downwards_trend", "📉")
466+ , ("scroll", "📜")
467+ , ("clipboard", "📋")
468+ , ("date", "📅")
469+ , ("calendar", "📆")
470+ , ("card_index", "📇")
471+ , ("file_folder", "📁")
472+ , ("open_file_folder", "📂")
473+ , ("scissors", "✂️")
474+ , ("pushpin", "📌")
475+ , ("paperclip", "📎")
476+ , ("black_nib", "✒️")
477+ , ("pencil2", "✏️")
478+ , ("straight_ruler", "📏")
479+ , ("triangular_ruler", "📐")
480+ , ("closed_book", "📕")
481+ , ("green_book", "📗")
482+ , ("blue_book", "📘")
483+ , ("orange_book", "📙")
484+ , ("notebook", "📓")
485+ , ("notebook_with_decorative_cover", "📔")
486+ , ("ledger", "📒")
487+ , ("books", "📚")
488+ , ("book", "📖")
489+ , ("open_book", "📖")
490+ , ("bookmark", "🔖")
491+ , ("name_badge", "📛")
492+ , ("microscope", "🔬")
493+ , ("telescope", "🔭")
494+ , ("newspaper", "📰")
495+ , ("art", "🎨")
496+ , ("clapper", "🎬")
497+ , ("microphone", "🎤")
498+ , ("headphones", "🎧")
499+ , ("musical_score", "🎼")
500+ , ("musical_note", "🎵")
501+ , ("notes", "🎶")
502+ , ("musical_keyboard", "🎹")
503+ , ("violin", "🎻")
504+ , ("trumpet", "🎺")
505+ , ("saxophone", "🎷")
506+ , ("guitar", "🎸")
507+ , ("space_invader", "👾")
508+ , ("video_game", "🎮")
509+ , ("black_joker", "🃏")
510+ , ("flower_playing_cards", "🎴")
511+ , ("mahjong", "🀄")
512+ , ("game_die", "🎲")
513+ , ("dart", "🎯")
514+ , ("football", "🏈")
515+ , ("basketball", "🏀")
516+ , ("soccer", "⚽")
517+ , ("baseball", "⚾️")
518+ , ("tennis", "🎾")
519+ , ("8ball", "🎱")
520+ , ("rugby_football", "🏉")
521+ , ("bowling", "🎳")
522+ , ("golf", "⛳")
523+ , ("mountain_bicyclist", "🚵")
524+ , ("bicyclist", "🚴")
525+ , ("checkered_flag", "🏁")
526+ , ("horse_racing", "🏇")
527+ , ("trophy", "🏆")
528+ , ("ski", "🎿")
529+ , ("snowboarder", "🏂")
530+ , ("swimmer", "🏊")
531+ , ("surfer", "🏄")
532+ , ("fishing_pole_and_fish", "🎣")
533+ , ("coffee", "☕")
534+ , ("tea", "🍵")
535+ , ("sake", "🍶")
536+ , ("baby_bottle", "🍼")
537+ , ("beer", "🍺")
538+ , ("beers", "🍻")
539+ , ("cocktail", "🍸")
540+ , ("tropical_drink", "🍹")
541+ , ("wine_glass", "🍷")
542+ , ("fork_and_knife", "🍴")
543+ , ("pizza", "🍕")
544+ , ("hamburger", "🍔")
545+ , ("fries", "🍟")
546+ , ("poultry_leg", "🍗")
547+ , ("meat_on_bone", "🍖")
548+ , ("spaghetti", "🍝")
549+ , ("curry", "🍛")
550+ , ("fried_shrimp", "🍤")
551+ , ("bento", "🍱")
552+ , ("sushi", "🍣")
553+ , ("fish_cake", "🍥")
554+ , ("rice_ball", "🍙")
555+ , ("rice_cracker", "🍘")
556+ , ("rice", "🍚")
557+ , ("ramen", "🍜")
558+ , ("stew", "🍲")
559+ , ("oden", "🍢")
560+ , ("dango", "🍡")
561+ , ("egg", "🍳")
562+ , ("bread", "🍞")
563+ , ("doughnut", "🍩")
564+ , ("custard", "🍮")
565+ , ("icecream", "🍦")
566+ , ("ice_cream", "🍨")
567+ , ("shaved_ice", "🍧")
568+ , ("birthday", "🎂")
569+ , ("cake", "🍰")
570+ , ("cookie", "🍪")
571+ , ("chocolate_bar", "🍫")
572+ , ("candy", "🍬")
573+ , ("lollipop", "🍭")
574+ , ("honey_pot", "🍯")
575+ , ("apple", "🍎")
576+ , ("green_apple", "🍏")
577+ , ("tangerine", "🍊")
578+ , ("lemon", "🍋")
579+ , ("cherries", "🍒")
580+ , ("grapes", "🍇")
581+ , ("watermelon", "🍉")
582+ , ("strawberry", "🍓")
583+ , ("peach", "🍑")
584+ , ("melon", "🍈")
585+ , ("banana", "🍌")
586+ , ("pear", "🍐")
587+ , ("pineapple", "🍍")
588+ , ("sweet_potato", "🍠")
589+ , ("eggplant", "🍆")
590+ , ("tomato", "🍅")
591+ , ("corn", "🌽")
592+ , ("house", "🏠")
593+ , ("house_with_garden", "🏡")
594+ , ("school", "🏫")
595+ , ("office", "🏢")
596+ , ("post_office", "🏣")
597+ , ("hospital", "🏥")
598+ , ("bank", "🏦")
599+ , ("convenience_store", "🏪")
600+ , ("love_hotel", "🏩")
601+ , ("hotel", "🏨")
602+ , ("wedding", "💒")
603+ , ("church", "⛪")
604+ , ("department_store", "🏬")
605+ , ("european_post_office", "🏤")
606+ , ("city_sunrise", "🌇")
607+ , ("city_sunset", "🌆")
608+ , ("japanese_castle", "🏯")
609+ , ("european_castle", "🏰")
610+ , ("tent", "⛺")
611+ , ("factory", "🏭")
612+ , ("tokyo_tower", "🗼")
613+ , ("japan", "🗾")
614+ , ("mount_fuji", "🗻")
615+ , ("sunrise_over_mountains", "🌄")
616+ , ("sunrise", "🌅")
617+ , ("night_with_stars", "🌃")
618+ , ("statue_of_liberty", "🗽")
619+ , ("bridge_at_night", "🌉")
620+ , ("carousel_horse", "🎠")
621+ , ("ferris_wheel", "🎡")
622+ , ("fountain", "⛲")
623+ , ("roller_coaster", "🎢")
624+ , ("ship", "🚢")
625+ , ("boat", "⛵")
626+ , ("sailboat", "⛵")
627+ , ("speedboat", "🚤")
628+ , ("rowboat", "🚣")
629+ , ("anchor", "⚓")
630+ , ("rocket", "🚀")
631+ , ("airplane", "✈️")
632+ , ("seat", "💺")
633+ , ("helicopter", "🚁")
634+ , ("steam_locomotive", "🚂")
635+ , ("tram", "🚊")
636+ , ("station", "🚉")
637+ , ("mountain_railway", "🚞")
638+ , ("train2", "🚆")
639+ , ("bullettrain_side", "🚄")
640+ , ("bullettrain_front", "🚅")
641+ , ("light_rail", "🚈")
642+ , ("metro", "🚇")
643+ , ("monorail", "🚝")
644+ , ("train", "🚋")
645+ , ("railway_car", "🚃")
646+ , ("trolleybus", "🚎")
647+ , ("bus", "🚌")
648+ , ("oncoming_bus", "🚍")
649+ , ("blue_car", "🚙")
650+ , ("oncoming_automobile", "🚘")
651+ , ("car", "🚗")
652+ , ("red_car", "🚗")
653+ , ("taxi", "🚕")
654+ , ("oncoming_taxi", "🚖")
655+ , ("articulated_lorry", "🚛")
656+ , ("truck", "🚚")
657+ , ("rotating_light", "🚨")
658+ , ("police_car", "🚓")
659+ , ("oncoming_police_car", "🚔")
660+ , ("fire_engine", "🚒")
661+ , ("ambulance", "🚑")
662+ , ("minibus", "🚐")
663+ , ("bike", "🚲")
664+ , ("aerial_tramway", "🚡")
665+ , ("suspension_railway", "🚟")
666+ , ("mountain_cableway", "🚠")
667+ , ("tractor", "🚜")
668+ , ("barber", "💈")
669+ , ("busstop", "🚏")
670+ , ("ticket", "🎫")
671+ , ("vertical_traffic_light", "🚦")
672+ , ("traffic_light", "🚥")
673+ , ("warning", "⚠️")
674+ , ("construction", "🚧")
675+ , ("beginner", "🔰")
676+ , ("fuelpump", "⛽")
677+ , ("izakaya_lantern", "🏮")
678+ , ("lantern", "🏮")
679+ , ("slot_machine", "🎰")
680+ , ("hotsprings", "♨️")
681+ , ("moyai", "🗿")
682+ , ("circus_tent", "🎪")
683+ , ("performing_arts", "🎭")
684+ , ("round_pushpin", "📍")
685+ , ("triangular_flag_on_post", "🚩")
686+ , ("jp", "🇯🇵")
687+ , ("kr", "🇰🇷")
688+ , ("de", "🇩🇪")
689+ , ("cn", "🇨🇳")
690+ , ("us", "🇺🇸")
691+ , ("fr", "🇫🇷")
692+ , ("es", "🇪🇸")
693+ , ("it", "🇮🇹")
694+ , ("ru", "🇷🇺")
695+ , ("gb", "🇬🇧")
696+ , ("uk", "🇬🇧")
697+ , ("one", "1️⃣")
698+ , ("two", "2️⃣")
699+ , ("three", "3️⃣")
700+ , ("four", "4️⃣")
701+ , ("five", "5️⃣")
702+ , ("six", "6️⃣")
703+ , ("seven", "7️⃣")
704+ , ("eight", "8️⃣")
705+ , ("nine", "9️⃣")
706+ , ("zero", "0️⃣")
707+ , ("keycap_ten", "🔟")
708+ , ("hash", "#️⃣")
709+ , ("symbols", "🔣")
710+ , ("arrow_up", "⬆️")
711+ , ("arrow_down", "⬇️")
712+ , ("arrow_left", "⬅️")
713+ , ("arrow_right", "➡️")
714+ , ("capital_abcd", "🔠")
715+ , ("abcd", "🔡")
716+ , ("abc", "🔤")
717+ , ("arrow_upper_right", "↗️")
718+ , ("arrow_upper_left", "↖️")
719+ , ("arrow_lower_right", "↘️")
720+ , ("arrow_lower_left", "↙️")
721+ , ("left_right_arrow", "↔️")
722+ , ("arrow_up_down", "↕️")
723+ , ("arrows_counterclockwise", "🔄")
724+ , ("arrow_backward", "◀️")
725+ , ("arrow_forward", "▶️")
726+ , ("arrow_up_small", "🔼")
727+ , ("arrow_down_small", "🔽")
728+ , ("leftwards_arrow_with_hook", "↩️")
729+ , ("arrow_right_hook", "↪️")
730+ , ("information_source", "ℹ️")
731+ , ("rewind", "⏪")
732+ , ("fast_forward", "⏩")
733+ , ("arrow_double_up", "⏫")
734+ , ("arrow_double_down", "⏬")
735+ , ("arrow_heading_down", "⤵️")
736+ , ("arrow_heading_up", "⤴️")
737+ , ("ok", "🆗")
738+ , ("twisted_rightwards_arrows", "🔀")
739+ , ("repeat", "🔁")
740+ , ("repeat_one", "🔂")
741+ , ("new", "🆕")
742+ , ("up", "🆙")
743+ , ("cool", "🆒")
744+ , ("free", "🆓")
745+ , ("ng", "🆖")
746+ , ("signal_strength", "📶")
747+ , ("cinema", "🎦")
748+ , ("koko", "🈁")
749+ , ("u6307", "🈯")
750+ , ("u7a7a", "🈳")
751+ , ("u6e80", "🈵")
752+ , ("u5408", "🈴")
753+ , ("u7981", "🈲")
754+ , ("ideograph_advantage", "🉐")
755+ , ("u5272", "🈹")
756+ , ("u55b6", "🈺")
757+ , ("u6709", "🈶")
758+ , ("u7121", "🈚")
759+ , ("restroom", "🚻")
760+ , ("mens", "🚹")
761+ , ("womens", "🚺")
762+ , ("baby_symbol", "🚼")
763+ , ("wc", "🚾")
764+ , ("potable_water", "🚰")
765+ , ("put_litter_in_its_place", "🚮")
766+ , ("parking", "🅿️")
767+ , ("wheelchair", "♿")
768+ , ("no_smoking", "🚭")
769+ , ("u6708", "🈷️")
770+ , ("u7533", "🈸")
771+ , ("sa", "🈂️")
772+ , ("m", "Ⓜ️")
773+ , ("passport_control", "🛂")
774+ , ("baggage_claim", "🛄")
775+ , ("left_luggage", "🛅")
776+ , ("customs", "🛃")
777+ , ("accept", "🉑")
778+ , ("secret", "㊙️")
779+ , ("congratulations", "㊗️")
780+ , ("cl", "🆑")
781+ , ("sos", "🆘")
782+ , ("id", "🆔")
783+ , ("no_entry_sign", "🚫")
784+ , ("underage", "🔞")
785+ , ("no_mobile_phones", "📵")
786+ , ("do_not_litter", "🚯")
787+ , ("non-potable_water", "🚱")
788+ , ("no_bicycles", "🚳")
789+ , ("no_pedestrians", "🚷")
790+ , ("children_crossing", "🚸")
791+ , ("no_entry", "⛔")
792+ , ("eight_spoked_asterisk", "✳️")
793+ , ("sparkle", "❇️")
794+ , ("negative_squared_cross_mark", "❎")
795+ , ("white_check_mark", "✅")
796+ , ("eight_pointed_black_star", "✴️")
797+ , ("heart_decoration", "💟")
798+ , ("vs", "🆚")
799+ , ("vibration_mode", "📳")
800+ , ("mobile_phone_off", "📴")
801+ , ("a", "🅰️")
802+ , ("b", "🅱️")
803+ , ("ab", "🆎")
804+ , ("o2", "🅾️")
805+ , ("diamond_shape_with_a_dot_inside", "💠")
806+ , ("loop", "➿")
807+ , ("recycle", "♻️")
808+ , ("aries", "♈")
809+ , ("taurus", "♉")
810+ , ("gemini", "♊")
811+ , ("cancer", "♋")
812+ , ("leo", "♌")
813+ , ("virgo", "♍")
814+ , ("libra", "♎")
815+ , ("scorpius", "♏")
816+ , ("sagittarius", "♐")
817+ , ("capricorn", "♑")
818+ , ("aquarius", "♒")
819+ , ("pisces", "♓")
820+ , ("ophiuchus", "⛎")
821+ , ("six_pointed_star", "🔯")
822+ , ("atm", "🏧")
823+ , ("chart", "💹")
824+ , ("heavy_dollar_sign", "💲")
825+ , ("currency_exchange", "💱")
826+ , ("copyright", "©️")
827+ , ("registered", "®️")
828+ , ("tm", "™️")
829+ , ("x", "❌")
830+ , ("bangbang", "‼️")
831+ , ("interrobang", "⁉️")
832+ , ("exclamation", "❗")
833+ , ("heavy_exclamation_mark", "❗")
834+ , ("question", "❓")
835+ , ("grey_exclamation", "❕")
836+ , ("grey_question", "❔")
837+ , ("o", "⭕")
838+ , ("top", "🔝")
839+ , ("end", "🔚")
840+ , ("back", "🔙")
841+ , ("on", "🔛")
842+ , ("soon", "🔜")
843+ , ("arrows_clockwise", "🔃")
844+ , ("clock12", "🕛")
845+ , ("clock1230", "🕧")
846+ , ("clock1", "🕐")
847+ , ("clock130", "🕜")
848+ , ("clock2", "🕑")
849+ , ("clock230", "🕝")
850+ , ("clock3", "🕒")
851+ , ("clock330", "🕞")
852+ , ("clock4", "🕓")
853+ , ("clock430", "🕟")
854+ , ("clock5", "🕔")
855+ , ("clock530", "🕠")
856+ , ("clock6", "🕕")
857+ , ("clock7", "🕖")
858+ , ("clock8", "🕗")
859+ , ("clock9", "🕘")
860+ , ("clock10", "🕙")
861+ , ("clock11", "🕚")
862+ , ("clock630", "🕡")
863+ , ("clock730", "🕢")
864+ , ("clock830", "🕣")
865+ , ("clock930", "🕤")
866+ , ("clock1030", "🕥")
867+ , ("clock1130", "🕦")
868+ , ("heavy_multiplication_x", "✖️")
869+ , ("heavy_plus_sign", "➕")
870+ , ("heavy_minus_sign", "➖")
871+ , ("heavy_division_sign", "➗")
872+ , ("spades", "♠️")
873+ , ("hearts", "♥️")
874+ , ("clubs", "♣️")
875+ , ("diamonds", "♦️")
876+ , ("white_flower", "💮")
877+ , ("heavy_check_mark", "✔️")
878+ , ("ballot_box_with_check", "☑️")
879+ , ("radio_button", "🔘")
880+ , ("link", "🔗")
881+ , ("curly_loop", "➰")
882+ , ("wavy_dash", "〰️")
883+ , ("part_alternation_mark", "〽️")
884+ , ("trident", "🔱")
885+ , ("black_medium_square", "◼️")
886+ , ("white_medium_square", "◻️")
887+ , ("black_medium_small_square", "◾")
888+ , ("white_medium_small_square", "◽")
889+ , ("black_small_square", "▪️")
890+ , ("white_small_square", "▫️")
891+ , ("small_red_triangle", "🔺")
892+ , ("black_square_button", "🔲")
893+ , ("white_square_button", "🔳")
894+ , ("black_circle", "⚫")
895+ , ("white_circle", "⚪")
896+ , ("red_circle", "🔴")
897+ , ("large_blue_circle", "🔵")
898+ , ("small_red_triangle_down", "🔻")
899+ , ("white_large_square", "⬜")
900+ , ("black_large_square", "⬛")
901+ , ("large_orange_diamond", "🔶")
902+ , ("large_blue_diamond", "🔷")
903+ , ("small_orange_diamond", "🔸")
904+ , ("small_blue_diamond", "🔹")
905+ ]
src/Text/Pandoc/Options.hs+2
@@ -105,6 +105,7 @@ data Extension =
105105 | Ext_ignore_line_breaks -- ^ Newlines in paragraphs are ignored
106106 | Ext_literate_haskell -- ^ Enable literate Haskell conventions
107107 | Ext_abbreviations -- ^ PHP markdown extra abbreviation definitions
108+ | Ext_emoji -- ^ Support emoji like :smile:
108109 | Ext_auto_identifiers -- ^ Automatic identifiers for headers
109110 | Ext_ascii_identifiers -- ^ ascii-only identifiers for headers
110111 | Ext_header_attributes -- ^ Explicit header attributes {#id .class k=v}
@@ -203,6 +204,7 @@ githubMarkdownExtensions = Set.fromList
203204 , Ext_intraword_underscores
204205 , Ext_strikeout
205206 , Ext_hard_line_breaks
207+ , Ext_emoji
206208 , Ext_lists_without_preceding_blankline
207209 , Ext_shortcut_reference_links
208210 ]
src/Text/Pandoc/Readers/Markdown.hs+17
@@ -39,6 +39,7 @@ import Data.Ord ( comparing )
3939import Data.Char ( isSpace, isAlphaNum, toLower )
4040import Data.Maybe
4141import Text.Pandoc.Definition
42+import Text.Pandoc.Emoji (emojis)
4243import qualified Data.Text as T
4344import Data.Text (Text)
4445import qualified Data.Yaml as Yaml
@@ -1467,6 +1468,7 @@ inline = choice [ whitespace
14671468 , exampleRef
14681469 , smart
14691470 , return . B.singleton <$> charRef
1471+ , emoji
14701472 , symbol
14711473 , ltSign
14721474 ] <?> "inline"
@@ -1898,6 +1900,21 @@ rawHtmlInline = do
18981900 else not . isTextTag
18991901 return $ return $ B.rawInline "html" result
19001902
1903+-- Emoji
1904+
1905+emojiChars :: [Char]
1906+emojiChars = ['a'..'z'] ++ ['0'..'9'] ++ ['_','+','-']
1907+
1908+emoji :: MarkdownParser (F Inlines)
1909+emoji = try $ do
1910+ guardEnabled Ext_emoji
1911+ char ':'
1912+ emojikey <- many1 (oneOf emojiChars)
1913+ char ':'
1914+ case M.lookup emojikey emojis of
1915+ Just s -> return (return (B.str s))
1916+ Nothing -> mzero
1917+
19011918-- Citations
19021919
19031920cite :: MarkdownParser (F Inlines)
tests/Tests/Readers/Markdown.hs+4
@@ -185,6 +185,10 @@ tests = [ testGroup "inline code"
185185 "<\n\na>" =?>
186186 para (text "<") <> para (text "a>")
187187 ]
188+ , testGroup "emoji"
189+ [ test markdownGH "emoji symbols" $
190+ ":smile: and :+1:" =?> para (text "😄 and 👍")
191+ ]
188192 , "unbalanced brackets" =:
189193 "[[[[[[[[[[[[[[[hi" =?> para (text "[[[[[[[[[[[[[[[hi")
190194 , testGroup "backslash escapes"