Skip to content

Commit

Permalink
page-breaker.js: Ignore text and comment nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Mar 23, 2022
1 parent ba0fbf2 commit 76d0b59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions public/js/layout-plugins/page-breaker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
}

if (remainingHeight < requiredHeight) {
if (!! item.previousSibling) {
item.previousSibling.style.pageBreakAfter = 'always';
item.previousSibling.classList.add('page-break-follows');
if (!! item.previousElementSibling) {
item.previousElementSibling.style.pageBreakAfter = 'always';
item.previousElementSibling.classList.add('page-break-follows');
} else {
item.style.pageBreakAfter = 'always';
item.classList.add('page-break-follows');
Expand Down
2 changes: 1 addition & 1 deletion public/js/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Layout
try {
plugin();
} catch (error) {
console.error('Layout plugin ' + name + ' failed run: ' + error);
console.error('Layout plugin ' + name + ' failed to run: ' + error);
}
}

Expand Down

0 comments on commit 76d0b59

Please sign in to comment.