- Shipped
- September 3, 2026 at 9:20 PM UTC
- Author
- Kamo
- Commit
- 1059e28
Quill 2's getSemanticHTML() -- the value react-quill-new hands to onChange, and so every byte of body a member types -- ends its text conversion with .replaceAll(" ", " "). Not just runs of spaces, not just the leading and trailing ones: every space in the message left the editor as U+00A0. U+00A0 is by definition a place a line may NOT break, so a paragraph arrived as one unbreakable word the width of the whole paragraph. The reading pane wraps bodies in overflow-wrap:break-word, which is there to stop a long URL overflowing the pane; handed a paragraph-length word it does the only thing it can and divides it at whatever letter the line runs out on, re-dividing on every resize. Gmail and Outlook do the same, so this was never a /messages display bug -- the sent message really was malformed, and it looked that way to everyone who received one. The repair is character-level, not CSS. breakableSpaces() puts ordinary spaces back wherever one renders identically: an interior lone nbsp becomes a plain space, a longer run keeps all but its last character non-breaking so it still occupies the same columns while offering a break at its end, and a run at a text node's start or end stays non-breaking because leading and trailing collapsible whitespace is discarded and the gap would visibly close. Wired in at two points. normalizeQuillHtmlForEmail repairs unconditionally -- that content came out of the editor, so its nbsp were substituted rather than chosen -- which fixes outgoing mail from the composer and from CampaignEditor, both of which share buildTemplateWrappedHtml. sanitizeEmailHtml repairs behind a gate, because everything already in the sent folder went out broken and cannot be re-sent: only text whose spacing is entirely non-breaking is touched, which no author writing a deliberate 10 kg -- or a spacer cell -- ever produces. Verified against a live Quill 2.0.3 instance rather than a reading of the minified source: setText('The quick brown fox') yields ****************