mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
don't collapse whitespace in extended paste mode
for pre tags
This commit is contained in:
parent
b17946b282
commit
e1338e8733
1 changed files with 5 additions and 2 deletions
|
@ -340,8 +340,11 @@ var filterHTML = function (html, internal, extendedMode) {
|
||||||
filterNode(top, extendedMode);
|
filterNode(top, extendedMode);
|
||||||
}
|
}
|
||||||
var outHtml = top.innerHTML;
|
var outHtml = top.innerHTML;
|
||||||
// remove newlines in HTML, as they break cloze deletions, and collapse whitespace
|
if (!extendedMode) {
|
||||||
outHtml = outHtml.replace(/[\n\t ]+/g, " ").trim();
|
// collapse whitespace
|
||||||
|
outHtml = outHtml.replace(/[\n\t ]+/g, " ");
|
||||||
|
}
|
||||||
|
outHtml = outHtml.trim();
|
||||||
//console.log(`input html: ${html}`);
|
//console.log(`input html: ${html}`);
|
||||||
//console.log(`outpt html: ${outHtml}`);
|
//console.log(`outpt html: ${outHtml}`);
|
||||||
return outHtml;
|
return outHtml;
|
||||||
|
|
Loading…
Reference in a new issue