diff --git a/packages/git-sync/src/lib/docmost-schema.ts b/packages/git-sync/src/lib/docmost-schema.ts index 249013fa..276efe90 100644 --- a/packages/git-sync/src/lib/docmost-schema.ts +++ b/packages/git-sync/src/lib/docmost-schema.ts @@ -238,7 +238,19 @@ const DocmostAttributes = Extension.create({ attributes: { id: { default: null }, indent: { default: null }, - textAlign: { default: null }, + // textAlign must round-trip the exported `
`
+ // (and the legacy `<... align="…">`) form (review #10). Without an
+ // explicit parseHTML the default reads a bare `textAlign` attribute
+ // (never present), so alignment was silently dropped on every import.
+ textAlign: {
+ default: null,
+ parseHTML: (el: HTMLElement) =>
+ el.style?.textAlign || el.getAttribute("align") || null,
+ renderHTML: (attrs: Record ` (review #10). The old
+ // ` `
+ // round-trips: the paragraph parse rule (tag:"p") matches and the
+ // textAlign global-attribute parseHTML (docmost-schema) reads the style.
+ return ` ${text}