Skip to content

Commit

Permalink
fix: prevent breaking inside SVG
Browse files Browse the repository at this point in the history
- fix (again) #1406
  • Loading branch information
MurakamiShinyu committed Nov 27, 2024
1 parent 3cfca03 commit f58e457
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/core/src/vivliostyle/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,12 @@ export class Column extends VtreeImpl.Container implements Layout.Column {
);
frame
.loopWithFrame((bodyFrame) => {
if (position.viewNode && !LayoutHelper.isSpecialNodeContext(position)) {
if (
position.viewNode &&
!LayoutHelper.isSpecialNodeContext(position) &&
// Prevent breaking inside SVG etc. (Issue #1406)
position.viewNode.parentElement?.namespaceURI === Base.NS.XHTML
) {
checkPoints.push(position.copy());
}
this.maybePeelOff(position, 0).then((position1Param) => {
Expand Down Expand Up @@ -2009,7 +2014,10 @@ export class Column extends VtreeImpl.Container implements Layout.Column {
const position = this.findEndOfLine(edgePosition, checkPoints, true);
let nodeContext = position.nodeContext;

if (position.checkPointIndex === 0 && position.index === nodeContext.boxOffset) {
if (
position.checkPointIndex === 0 &&
position.index === nodeContext.boxOffset
) {
// Prevent wrong break at beginning of paragraph (Issue #1401, #1406)
return null;
}
Expand Down

0 comments on commit f58e457

Please sign in to comment.