Fixed emojify should exclude parsing svg and catch its exception

This commit is contained in:
Cheng-Han, Wu 2016-01-31 15:29:20 -06:00
parent ba4a7b13b3
commit 3c2a2a348b

View file

@ -196,7 +196,11 @@ function finishView(view) {
$(value).gist(viewAjaxCallback); $(value).gist(viewAjaxCallback);
}); });
//emojify //emojify
try {
emojify.run(view[0]); emojify.run(view[0]);
} catch (err) {
console.error(err);
}
//mathjax //mathjax
var mathjaxdivs = view.find('.mathjax.raw').removeClass("raw").toArray(); var mathjaxdivs = view.find('.mathjax.raw').removeClass("raw").toArray();
try { try {
@ -652,6 +656,10 @@ function highlightRender(code, lang) {
} }
emojify.setConfig({ emojify.setConfig({
blacklist: {
elements: ['script', 'textarea', 'a', 'pre', 'code', 'svg'],
classes: ['no-emojify']
},
img_dir: '/vendor/emojify/images', img_dir: '/vendor/emojify/images',
ignore_emoticons: true ignore_emoticons: true
}); });