mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 16:36:15 -04:00
ImportHtml: Reuse the HTML processor
This commit is contained in:
parent
db105e8650
commit
afdb01681a
1 changed files with 4 additions and 5 deletions
|
@ -23,11 +23,10 @@ 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) => {
|
||||
processor.process(html, (err, output) => {
|
||||
html = String(output);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue