preserve linebreaks in live-preview error text

fixes #460
This commit is contained in:
tophf 2018-08-06 13:13:15 +03:00
parent a5a713be8a
commit e27636b93d

View File

@ -686,7 +686,8 @@ onDOMscriptReady('/codemirror.js').then(() => {
}).then(() => { }).then(() => {
errors.classList.add('hidden'); errors.classList.add('hidden');
}).catch(err => { }).catch(err => {
if (err && editor && !Number.isNaN(err.index)) { if (Array.isArray(err)) err = err.join('\n');
if (err && editor && !isNaN(err.index)) {
const pos = editors[0].posFromIndex(err.index); const pos = editors[0].posFromIndex(err.index);
err = `${pos.line}:${pos.ch} ${err}`; err = `${pos.line}:${pos.ch} ${err}`;
} }