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);
});
//emojify
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
});