diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 7c638fb8c..322e567e6 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -31,7 +31,13 @@ function setPadHTML(pad, html, callback) var padText = pad.text(); // Parse the incoming HTML with jsdom - var doc = jsdom(html.replace(/>\n+<')); + try{ + var doc = jsdom(html.replace(/>\n+<')); + }catch(e){ + apiLogger.warn("Error importing, possibly caused by malformed HTML"); + var doc = jsdom("
Error during import, possibly malformed HTML
"); + } + apiLogger.debug('html:'); apiLogger.debug(html);