@json-to-office/core-docx 7.7.0 → 7.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5091,6 +5091,12 @@ function buildDocument(ir, resources = /* @__PURE__ */ new Map(), pageNumbers, e
5091
5091
  updateFields: ir.settings.updateFields,
5092
5092
  ...ir.settings.trackRevisions ? { trackRevisions: true } : {}
5093
5093
  },
5094
+ // A text's `\n` is a manual line break inside its paragraph, and Word
5095
+ // stretches the line before one across the whole width of a justified
5096
+ // paragraph — a two-word line spread edge to edge. `w:doNotExpandShiftReturn`
5097
+ // sets that line flush like the last line of a paragraph, the way every
5098
+ // reader expects. docx keeps compatibility mode 15 alongside it.
5099
+ compatibility: { doNotExpandShiftReturn: true },
5094
5100
  ...ir.numbering.length > 0 ? { numbering: { config: ir.numbering.map(numberingConfig) } } : {},
5095
5101
  // word/footnotes.xml and word/endnotes.xml, keyed by the id their
5096
5102
  // references carry.
@@ -6812,7 +6818,19 @@ async function buildDocumentOptions(ir, charts2 = [], svgRasterFallback) {
6812
6818
  ...coreProperties2(ir),
6813
6819
  settings: {
6814
6820
  updateFields: ir.settings.updateFields,
6815
- ...ir.settings.trackRevisions ? { trackRevisions: true } : {}
6821
+ ...ir.settings.trackRevisions ? { trackRevisions: true } : {},
6822
+ // A text's `\n` is a manual line break inside its paragraph, and Word
6823
+ // stretches the line before one across the whole width of a justified
6824
+ // paragraph. `w:doNotExpandShiftReturn` sets that line flush instead.
6825
+ // Passing `compatibility` replaces @office-open/docx's fresh-document
6826
+ // defaults rather than extending them, so they are restated here.
6827
+ compatibility: {
6828
+ version: 15,
6829
+ overrideTableStyleFontSizeAndJustification: true,
6830
+ enableOpenTypeFeatures: true,
6831
+ doNotFlipMirrorIndents: true,
6832
+ doNotExpandShiftReturn: true
6833
+ }
6816
6834
  },
6817
6835
  ...ir.numbering.length > 0 ? {
6818
6836
  numbering: {