Commit 4d69423f authored by Fred Chasen's avatar Fred Chasen

Fix createBreakToken for text

parent b77cb92e
Pipeline #69 failed with stage
in 2 minutes and 39 seconds
......@@ -92,7 +92,7 @@ class Layout {
this.hooks && this.hooks.layoutNode.trigger(node);
// Check if the rendered element has a breakBefore set
// Check if the rendered element has a break set
if (hasContent && this.shouldBreak(node)) {
newBreakToken = this.findBreakToken(wrapper, source, bounds);
......@@ -240,22 +240,23 @@ class Layout {
node = findElement(renderedNode, source);
offset = 0;
} else {
renderedNode = findElement(container, rendered);
if (!renderedNode) {
renderedNode = findElement(prevValidNode(container), rendered);
}
parent = findElement(renderedNode, source);
index = indexOf(temp);
node = child(parent, index);
offset = 0;
console.error("Non-element found for breakToken", temp);
// renderedNode = findElement(container, rendered);
//
// if (!renderedNode) {
// renderedNode = findElement(prevValidNode(container), rendered);
// }
//
// parent = findElement(renderedNode, source);
// index = indexOf(temp);
// node = child(parent, index);
// offset = 0;
}
} else {
renderedNode = findElement(container, rendered);
renderedNode = findElement(container.parentNode, rendered);
if (!renderedNode) {
renderedNode = findElement(prevValidNode(container), rendered);
renderedNode = findElement(prevValidNode(container.parentNode), rendered);
}
parent = findElement(renderedNode, source);
......
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