From 3c2a2a348b9df16ce22e9385adf12f2f51ddec58 Mon Sep 17 00:00:00 2001 From: "Cheng-Han, Wu" Date: Sun, 31 Jan 2016 15:29:20 -0600 Subject: [PATCH] Fixed emojify should exclude parsing svg and catch its exception --- public/js/extra.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/js/extra.js b/public/js/extra.js index a657699..2c9c903 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -196,7 +196,11 @@ function finishView(view) { $(value).gist(viewAjaxCallback); }); //emojify - emojify.run(view[0]); + try { + emojify.run(view[0]); + } catch (err) { + console.error(err); + } //mathjax var mathjaxdivs = view.find('.mathjax.raw').removeClass("raw").toArray(); try { @@ -652,6 +656,10 @@ function highlightRender(code, lang) { } emojify.setConfig({ + blacklist: { + elements: ['script', 'textarea', 'a', 'pre', 'code', 'svg'], + classes: ['no-emojify'] + }, img_dir: '/vendor/emojify/images', ignore_emoticons: true });