no title replacement

no rehype-format
replace newlines with spaces
This commit is contained in:
webzwo0i 2020-09-14 13:56:12 +02:00
parent 17fac52aba
commit eee8d56477
2 changed files with 5 additions and 5 deletions

View file

@ -215,8 +215,8 @@ async function doImport(req, res, padId)
* @todo what happens if <title is used somewhere in the pad? need proper XML parser
* @todo does not work all the time
*/
text = text.replace("<title", "<!-- <title");
text = text.replace("</title>","</title>-->");
//text = text.replace("<title", "<!-- <title");
//text = text.replace("</title>","</title>-->");
// node on windows has a delay on releasing of the file lock.
// We add a 100ms delay to work around this

View file

@ -19,7 +19,7 @@ const Changeset = require("ep_etherpad-lite/static/js/Changeset");
const contentcollector = require("ep_etherpad-lite/static/js/contentcollector");
const cheerio = require("cheerio");
const rehype = require("rehype")
const format = require("rehype-format")
//const format = require("rehype-format")
exports.setPadHTML = function(pad, html)
@ -32,9 +32,9 @@ exports.setPadHTML = function(pad, html)
}
rehype()
.use(format, opts)
// .use(format, opts)
.process(html, function(err, output){
//html = String(output).replace(/(\r\n|\n|\r)/gm,"");
html = String(output).replace(/(\n\r|\n|\r)/gm," ");
})
var $ = cheerio.load(html);