Skip to content
Bug reportNov 8, 2026· 0:24· 15 views

Quill 2.0.3: getSemanticHTML() preserves   instead of converting to regular spaces

0:24 total

Comments · 0

Be the first to comment.

Bug reportby SceneRecap AI

mediumQuill getSemanticHTML() serialization of text nodes (handling of U+00A0 /   in semantic HTML output)
os: macOSdpr: 1locale: en-USbrowser: Chromium 151.0.7922.34library: Quill 2.0.3 (cdn.jsdelivr.net)timezone: Europe/Berlinviewport: 1280x720

Repro steps

  1. 1.Open the Quill 2.0.3 test page for slab/quill#4509. Quill loads from cdn.jsdelivr.net.
  2. 2.Call quill.setContents with insert 'a\u00a0text\u00a0with\u00a0multiple\u00a0spaces'.
  3. 3.Call quill.getSemanticHTML() and inspect the returned string.

Expected

getSemanticHTML() returns "<p>a text with multiple spaces</p>", with non-breaking spaces converted to regular spaces in the semantic output.

Actual

getSemanticHTML() returns "<p>a&nbsp;text&nbsp;with&nbsp;multiple&nbsp;spaces</p>". The &nbsp; entities are preserved.

Evidence

visualThe output panel shows quill.getSemanticHTML() returning "<p>a&nbsp;text&nbsp;with&nbsp;multiple&nbsp;spaces</p>".
visualThe expected value shown is "<p>a text with multiple spaces</p>". A comment reads '✗ &nbsp; entities preserved, semantics changed'.
visualThe editor visibly renders 'a text with multiple spaces' while the output panel still shows 'Loading…'.
visualThe output stays unchanged through the end of the recording.
consoleWarning: parser-blocking cross-site script https://cdn.jsdelivr.net/npm/quill@2.0.3/dist/quill.js is invoked via document.write. This is unrelated to the bug. Quill loaded and ran.
Issue markdown (copy-paste ready)
## Summary
In Quill 2.0.3, `getSemanticHTML()` keeps non-breaking spaces as `&nbsp;` entities. It does not convert them to regular spaces (slab/quill#4509).

## Environment
- Chromium 151.0.7922.34, macOS
- Viewport 1280x720, dpr 1, en-US, Europe/Berlin
- Quill 2.0.3 from cdn.jsdelivr.net

## Steps to reproduce
1. Load Quill 2.0.3 (1s).
2. Run `quill.setContents([{ insert: "a\u00a0text\u00a0with\u00a0multiple\u00a0spaces" }])` (5s).
3. Call `quill.getSemanticHTML()` (5s).

## Expected
`"<p>a text with multiple spaces</p>"`

## Actual
`"<p>a&nbsp;text&nbsp;with&nbsp;multiple&nbsp;spaces</p>"` (shown at 5s, unchanged through 23s).

## Evidence
- 5s: The output panel shows the actual result next to the expected value. A comment marks it as failing: entities preserved, semantics changed.
- 1s: The editor renders the text as 'a text with multiple spaces'.
- 0s: A console warning reports that quill.js is loaded via document.write. This is unrelated, and Quill loaded fine.

## Suggested area
The text serialization in `getSemanticHTML()`, specifically how U+00A0 is emitted.

*Recorded with SceneRecap.*

Your recordings could explain themselves too.

Free plan · silent recordings welcome · bug reports included.

Try SceneRecap free →
Quill 2.0.3: getSemanticHTML() preserves &nbsp; instead of converting to regular spaces · SceneRecap