Merge pull request #569 from evandroforks/limit_error_message_size

Also limit the size of the error message
This commit is contained in:
Damien Elmes 2020-04-20 11:14:53 +10:00 committed by GitHub
commit 385dbf88c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,11 +40,12 @@ function _updateQA(html, fadeTime, onupdate, onshown) {
qa.html(html); qa.html(html);
} catch (err) { } catch (err) {
qa.html( qa.html(
"Invalid HTML on card: " + (
err + `Invalid HTML on card: ${String(err).substring(
("\n" + err.stack) 0,
.substring(0, 2000) 2000
.replace(/\n/g, "<br />") )}\n` + String(err.stack).substring(0, 2000)
).replace(/\n/g, "<br />")
); );
} }
_runHook(onUpdateHook); _runHook(onUpdateHook);