Skip to content

Commit 8b1da54

Browse files
committed
docs(pm-adapter): note why w:bar is not normalized
Word does not render w:bar borders on display (only preserves them on save). SuperDoc currently matches that behavior by omitting 'bar' from the normalized sides list. Add a note at the source of truth so future contributors don't re-add it without a real use case.
1 parent 7a7846f commit 8b1da54

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

  • packages/layout-engine/pm-adapter/src/attributes

packages/layout-engine/pm-adapter/src/attributes/borders.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ export function extractCellPadding(cellAttrs: Record<string, unknown>): BoxSpaci
324324
export const normalizeParagraphBorders = (value: unknown): ParagraphAttrs['borders'] | undefined => {
325325
if (!value || typeof value !== 'object') return undefined;
326326
const source = value as Record<string, unknown>;
327+
// Note: w:bar is intentionally not in this list. We tested in Word and it
328+
// never draws w:bar on screen — it just keeps the value in the file when
329+
// saving. The spec lets apps skip it, and Word does. SuperDoc does too, by
330+
// default. If you have a real document where bar needs to be drawn, open
331+
// an issue with the use case before adding 'bar' here.
327332
const sides: Array<'top' | 'right' | 'bottom' | 'left' | 'between'> = ['top', 'right', 'bottom', 'left', 'between'];
328333
const borders: ParagraphAttrs['borders'] = {};
329334

0 commit comments

Comments
 (0)