From abf4eeeb173f768f7350b63021d700527537f492 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 15 Nov 2021 03:18:27 -0500 Subject: [PATCH] ImportHtml: Wait for HTML processing to complete --- src/node/utils/ImportHtml.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/node/utils/ImportHtml.js b/src/node/utils/ImportHtml.js index 807dab536..58b79f3a1 100644 --- a/src/node/utils/ImportHtml.js +++ b/src/node/utils/ImportHtml.js @@ -26,10 +26,7 @@ const apiLogger = log4js.getLogger('ImportHtml'); const processor = rehype().use(minifyWhitespace, {newlines: false}); exports.setPadHTML = async (pad, html) => { - processor.process(html, (err, output) => { - html = String(output); - }); - + html = String(await processor.process(html)); const {window: {document}} = new jsdom.JSDOM(html); // Appends a line break, used by Etherpad to ensure a caret is available