diff options
author | Cheng-Han, Wu | 2016-01-31 15:29:20 -0600 |
---|---|---|
committer | Cheng-Han, Wu | 2016-01-31 15:29:20 -0600 |
commit | 3c2a2a348b9df16ce22e9385adf12f2f51ddec58 (patch) | |
tree | 341543b1a1a0ca3cf44df8a530dc18a2c999bc72 | |
parent | ba4a7b13b33492d388e1ebdd602a744b2221bd76 (diff) |
Fixed emojify should exclude parsing svg and catch its exception
-rw-r--r-- | public/js/extra.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/public/js/extra.js b/public/js/extra.js index a6576991..2c9c9037 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 }); |