Commit ee171cbb authored by Fred Chasen's avatar Fred Chasen

Merge branch 'allow_empty_in_pre' into 'master'

Allow whitespace in pre element

See merge request !33
parents 1633942d d5b9dc0e
import { UUID } from "../utils/utils";
import { isElement } from "../utils/dom";
/**
* Render a flow of text offscreen
......@@ -77,6 +78,15 @@ class ContentParser {
{ acceptNode: function(node) {
// Only remove more than a single space
if (node.textContent.length > 1 && !node.textContent.trim()) {
// Don't touch whitespace if text is preformated
let parent = node.parentNode;
let pre = isElement(parent) && parent.closest("pre");
console.log(pre);
if (pre) {
return NodeFilter.FILTER_REJECT;
}
return NodeFilter.FILTER_ACCEPT;
} else {
return NodeFilter.FILTER_REJECT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment