diff --git a/demo/text/word-wrap.ts b/demo/text/word-wrap.ts index 442de9ebd4..b03a0a8de2 100644 --- a/demo/text/word-wrap.ts +++ b/demo/text/word-wrap.ts @@ -1,4 +1,6 @@ -// Example on how to preserve word wrap text. Works with all languages. +// Example of `wordWrap`, Word's "Allow Latin text to wrap in the middle of a word", which lets lines break inside the words +// of runs in an East Asian font or language, Korean words too, which Word otherwise keeps together. Words in other runs still +// break at their spaces. Leave it unset to keep Korean words whole, unless the paragraph's style sets it. import * as fs from "fs"; import { Document, Packer, Paragraph, TextRun } from "docx"; diff --git a/src/file/paragraph/properties.ts b/src/file/paragraph/properties.ts index d5bd98c730..087d0a1c28 100644 --- a/src/file/paragraph/properties.ts +++ b/src/file/paragraph/properties.ts @@ -166,7 +166,13 @@ export type IParagraphPropertiesOptionsBase = { readonly frame?: IFrameOptions; /** Whether to suppress line numbers for this paragraph */ readonly suppressLineNumbers?: boolean; - /** Whether to allow word wrapping */ + /** + * Word's "Allow Latin text to wrap in the middle of a word". `true` writes ``, which lets lines + * break inside the words of runs in an East Asian font or language, Latin and Korean words alike, where Word otherwise + * keeps words together. Words in other runs, such as English in Calibri, still break at their spaces. When it is unset, the + * paragraph keeps its style's setting, so Latin and Korean text breaks at the spaces between words unless a style sets + * `w:wordWrap` to `0`. + */ readonly wordWrap?: boolean; /** Whether to allow punctuation to extend beyond text margins */ readonly overflowPunctuation?: boolean;