ignore easymde errors

it randomly throws when clicking inside the preview pane
This commit is contained in:
ed 2024-02-14 23:26:06 +00:00
parent 64ad585318
commit 879e83e24f

View file

@ -157,6 +157,10 @@ catch (ex) {
} }
var crashed = false, ignexd = {}, evalex_fatal = false; var crashed = false, ignexd = {}, evalex_fatal = false;
function vis_exh(msg, url, lineNo, columnNo, error) { function vis_exh(msg, url, lineNo, columnNo, error) {
var ekey = url + '\n' + lineNo + '\n' + msg;
if (ignexd[ekey] || crashed)
return;
msg = String(msg); msg = String(msg);
url = String(url); url = String(url);
@ -175,9 +179,8 @@ function vis_exh(msg, url, lineNo, columnNo, error) {
if (IE && url.indexOf('prism.js') + 1) if (IE && url.indexOf('prism.js') + 1)
return; return;
var ekey = url + '\n' + lineNo + '\n' + msg; if (url.indexOf('easymde.js') + 1)
if (ignexd[ekey] || crashed) return; // clicking the preview pane
return;
if (url.indexOf('deps/marked.js') + 1 && !window.WebAssembly) if (url.indexOf('deps/marked.js') + 1 && !window.WebAssembly)
return; // ff<52 return; // ff<52