Summary
Render w:between paragraph borders — the horizontal line drawn between consecutive paragraphs that share the same border group.
Current State
Basic paragraph borders (w:pBdr) for the 4 standard sides (top, bottom, left, right) are already implemented:
- Converter:
pBdr-translator.js parses all 6 sides (including between and bar) and stores them in paragraphProperties.borders
- Style-engine: borders flow through the full cascade (docDefaults → styles → inline)
- pm-adapter:
normalizeParagraphBorders() converts top, right, bottom, left to layout format
- DomPainter: renders borders as an absolutely-positioned overlay div with CSS border properties
However, between borders are parsed but silently dropped in normalizeParagraphBorders() — only ['top', 'right', 'bottom', 'left'] are processed. The between value never reaches the DomPainter.
Problem
When a Word document uses w:pBdr/w:between to draw horizontal separators between consecutive paragraphs in a border group (e.g., callout boxes, grouped list items), the separator lines don't render in SuperDoc.
What needs to change
- pm-adapter (
packages/layout-engine/pm-adapter/src/attributes/borders.ts): Include between in normalizeParagraphBorders() so it flows to the layout format.
- Contracts (
packages/layout-engine/contracts/src/index.ts): Add between to the ParagraphBorder type on ParagraphAttrs.
- DomPainter (
packages/layout-engine/painters/dom/src/renderer.ts): Render between borders. This is the trickiest part — between borders are drawn as a horizontal line at the bottom of each paragraph in the group except the last one. The renderer needs to know whether the next paragraph shares the same border group.
Notes
- OOXML spec §17.3.1.24 defines
w:between behavior
- The
bar border (vertical decorative bar) is a separate feature tracked in a different issue
- The existing test documents attached to this issue can be used for validation
Attachments
paragraph_borders_all_styles_0.5pt_TOP_ONLY.docx
paragraph_borders_2pt_single_colors.docx
paragraph_borders_all_styles_0.5pt.docx
paragraph_borders_all_styles_2pt.docx
Want to work on this? Check the Contributing Guide to get started. Comment on this issue to let us know you're picking it up.
Ref: SD-1741
Summary
Render
w:betweenparagraph borders — the horizontal line drawn between consecutive paragraphs that share the same border group.Current State
Basic paragraph borders (
w:pBdr) for the 4 standard sides (top,bottom,left,right) are already implemented:pBdr-translator.jsparses all 6 sides (includingbetweenandbar) and stores them inparagraphProperties.bordersnormalizeParagraphBorders()convertstop,right,bottom,leftto layout formatHowever,
betweenborders are parsed but silently dropped innormalizeParagraphBorders()— only['top', 'right', 'bottom', 'left']are processed. Thebetweenvalue never reaches the DomPainter.Problem
When a Word document uses
w:pBdr/w:betweento draw horizontal separators between consecutive paragraphs in a border group (e.g., callout boxes, grouped list items), the separator lines don't render in SuperDoc.What needs to change
packages/layout-engine/pm-adapter/src/attributes/borders.ts): IncludebetweeninnormalizeParagraphBorders()so it flows to the layout format.packages/layout-engine/contracts/src/index.ts): Addbetweento theParagraphBordertype onParagraphAttrs.packages/layout-engine/painters/dom/src/renderer.ts): Renderbetweenborders. This is the trickiest part —betweenborders are drawn as a horizontal line at the bottom of each paragraph in the group except the last one. The renderer needs to know whether the next paragraph shares the same border group.Notes
w:betweenbehaviorbarborder (vertical decorative bar) is a separate feature tracked in a different issueAttachments
paragraph_borders_all_styles_0.5pt_TOP_ONLY.docx
paragraph_borders_2pt_single_colors.docx
paragraph_borders_all_styles_0.5pt.docx
paragraph_borders_all_styles_2pt.docx
Want to work on this? Check the Contributing Guide to get started. Comment on this issue to let us know you're picking it up.
Ref: SD-1741