mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 00:46:16 -04:00
deps: Bump rehype and rehype-minify-whitespace
This commit is contained in:
parent
1e604add99
commit
9db3424403
3 changed files with 169 additions and 140 deletions
|
@ -19,13 +19,17 @@ const log4js = require('log4js');
|
|||
const Changeset = require('../../static/js/Changeset');
|
||||
const contentcollector = require('../../static/js/contentcollector');
|
||||
const jsdom = require('jsdom');
|
||||
const rehype = require('rehype');
|
||||
const minifyWhitespace = require('rehype-minify-whitespace');
|
||||
|
||||
const apiLogger = log4js.getLogger('ImportHtml');
|
||||
const processor = rehype().use(minifyWhitespace, {newlines: false});
|
||||
let processor;
|
||||
|
||||
exports.setPadHTML = async (pad, html) => {
|
||||
if (processor == null) {
|
||||
const [{rehype}, {default: minifyWhitespace}] =
|
||||
await Promise.all([import('rehype'), import('rehype-minify-whitespace')]);
|
||||
processor = rehype().use(minifyWhitespace, {newlines: false});
|
||||
}
|
||||
|
||||
html = String(await processor.process(html));
|
||||
const {window: {document}} = new jsdom.JSDOM(html);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue