Commit 00f5d50f authored by Guillaume's avatar Guillaume

Avoid breaking on the first and only row in the thead

parent abdb2192
Pipeline #802 canceled with stage
......@@ -461,12 +461,16 @@ class Layout {
if (!range && left >= end) {
// Check if it is a float
let isFloat = false;
// Check if the node is inside a break-inside: avoid table cell
const insideTableCell = parentOf(node, "TD", rendered);
if (insideTableCell && window.getComputedStyle(insideTableCell)["break-inside"] === "avoid") {
// breaking inside a table cell produces unexpected result, as a workaround, we forcibly avoid break inside in a cell.
prev = insideTableCell;
// Check if the node is the first and only row in the thead
else if (node.parentNode.nodeName === "THEAD" && node.parentNode.childElementCount === 1) {
// break on the table otherwise it will produce an empty table
prev = node.parentNode.parentNode;
} else if (isElement(node)) {
let styles = window.getComputedStyle(node);
isFloat = styles.getPropertyValue("float") !== "none";
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