Commit d5098e8a authored by Fred Chasen's avatar Fred Chasen
Browse files

fix whitespace filter check

parent 43c7daa4
Pipeline #501 failed with stage
in 3 minutes and 50 seconds
......@@ -24,8 +24,9 @@ class WhiteSpaceFilter extends Handler {
return NodeFilter.FILTER_REJECT;
}
const nextSibling = previousSignificantNode(node);
const previousSibling = nextSignificantNode(node);
const previousSibling = previousSignificantNode(node);
const nextSibling = nextSignificantNode(node);
if (nextSibling === null && previousSibling === null) {
// we should not remove a Node that does not have any siblings.
node.textContent = " ";
......
......@@ -587,6 +587,7 @@ export function previousSignificantNode(sib) {
while ((sib = sib.previousSibling)) {
if (!isIgnorable(sib)) return sib;
}
return null;
}
/**
......@@ -602,6 +603,7 @@ export function nextSignificantNode(sib) {
while ((sib = sib.nextSibling)) {
if (!isIgnorable(sib)) return sib;
}
return null;
}
export function filterTree(content, func, what) {
......
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