mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-05-10 14:46:20 +02:00
ImportHtml: Reuse the HTML processor
This commit is contained in:
parent
db105e8650
commit
afdb01681a
@ -23,13 +23,12 @@ const rehype = require('rehype');
|
||||
const minifyWhitespace = require('rehype-minify-whitespace');
|
||||
|
||||
const apiLogger = log4js.getLogger('ImportHtml');
|
||||
const processor = rehype().use(minifyWhitespace, {newlines: false});
|
||||
|
||||
exports.setPadHTML = async (pad, html) => {
|
||||
rehype()
|
||||
.use(minifyWhitespace, {newlines: false})
|
||||
.process(html, (err, output) => {
|
||||
html = String(output);
|
||||
});
|
||||
processor.process(html, (err, output) => {
|
||||
html = String(output);
|
||||
});
|
||||
|
||||
const {window: {document}} = new jsdom.JSDOM(html);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user