Skip to content

Commit

Permalink
Paratext: Improve table import
Browse files Browse the repository at this point in the history
Previously, the TABLE_ROW_FIRST_CELL and TABLE_ROW_NEXT_CELL of
subsequent table rows were still separated by PARAGRAPH elements caused
by the `\tr` USFM tag. Skip those so that tables do not get between each
row.
  • Loading branch information
schierlm committed Oct 23, 2024
1 parent 18b899b commit b9fa293
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ public void visitParagraphStart(ParagraphKind kind) throws RuntimeException {
if (exportAllTags && kind.getCategory() == ParagraphKindCategory.SKIP && ctx.currentVisitor != null) {
ctx.currentVisitor.visitCSSFormatting("-bmc-usfm-tag: " + kind.getTag()).visitText("\uFEFF");
}
boolean subsequentTableRow = kind.getCategory() == ParagraphKindCategory.TABLE_ROW && ctx.outsideCellVisitor != null;
ctx.outsideCellVisitor = null;
ctx.insideTableHead = false;
ExtendedLineBreakKind elbk = kind.getLineBreakKind();
Expand All @@ -209,7 +210,7 @@ public void visitParagraphStart(ParagraphKind kind) throws RuntimeException {
if (elbk != null) {
ctx.currentVisitor.visitLineBreak(elbk, kind.getLineBreakIndent());
elbk = null;
} else {
} else if (!subsequentTableRow) {
ctx.currentVisitor.visitLineBreak(ExtendedLineBreakKind.PARAGRAPH, 0);
}
}
Expand Down

0 comments on commit b9fa293

Please sign in to comment.