ImportHtml: Reuse the HTML processor
parent
db105e8650
commit
afdb01681a
|
@ -23,11 +23,10 @@ const rehype = require('rehype');
|
||||||
const minifyWhitespace = require('rehype-minify-whitespace');
|
const minifyWhitespace = require('rehype-minify-whitespace');
|
||||||
|
|
||||||
const apiLogger = log4js.getLogger('ImportHtml');
|
const apiLogger = log4js.getLogger('ImportHtml');
|
||||||
|
const processor = rehype().use(minifyWhitespace, {newlines: false});
|
||||||
|
|
||||||
exports.setPadHTML = async (pad, html) => {
|
exports.setPadHTML = async (pad, html) => {
|
||||||
rehype()
|
processor.process(html, (err, output) => {
|
||||||
.use(minifyWhitespace, {newlines: false})
|
|
||||||
.process(html, (err, output) => {
|
|
||||||
html = String(output);
|
html = String(output);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue