From 63f2b5744fdd5d67f284d66884ddebddb618e23c Mon Sep 17 00:00:00 2001 From: OldHawk Date: Wed, 15 Nov 2017 18:12:19 +0800 Subject: [PATCH] feat(emoji): add emoji support in markdown --- modules/core/client/app/init.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/core/client/app/init.js b/modules/core/client/app/init.js index a7aeb29d..de62e622 100644 --- a/modules/core/client/app/init.js +++ b/modules/core/client/app/init.js @@ -92,6 +92,24 @@ //}, table: function (header, body) { return '' + header + '' + body + '
'; + }, + text: function (text) { + var RexStr = /:([A-Za-z0-9_\-\+]+?):/g; + text = text.replace(RexStr, function (match, emoji) { + return ''
+            + emoji
+            + ''; + }); + + return text; } }); }