ImportHtml: Wait for HTML processing to complete

This commit is contained in:
Richard Hansen 2021-11-15 03:18:27 -05:00
parent 50dce085c2
commit abf4eeeb17
1 changed files with 1 additions and 4 deletions

View File

@ -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