Zerowidth CleanerMeasured guides

CLAUDE WATERMARK REMOVER · MARKDOWN TEST

Can removing a hidden character activate a Markdown hard break?

Yes. Once U+200B is removed, two ordinary spaces directly precede the newline and the parser emits a hard break.

Tested 9 November 2026 · Synthetic fixture · CommonMark.js 0.31.2

What changed in the preview

The original line has two ASCII spaces followed by U+200B and a newline. Before cleanup there is no br element because the hidden character interrupts the trailing-space marker. After the callback removes it, the spaces remain and the parser emits br between the sentences. Inspect both trailing spaces and the hidden character when a destination preview introduces or loses a deliberate break. Stripping all trailing spaces would address a different editing policy and could erase intentional hard breaks elsewhere in the same document.

What this test covers

This uses a two-space line ending inside a paragraph. A backslash break, a code span or a renderer configured to hard-wrap soft breaks requires a separate check.

Measured HTML

The first preview contains a literal U+200B, displayed below as \u200B. The HTML is shown as text.

Before cleanup

<p>First line.  \u200B
Second line.</p>

After cleanup

<p>First line.<br />
Second line.</p>

Reproduce locally

Save reproduce.cjs and tested-app.js together. Run npm install --no-save commonmark@0.31.2, then node reproduce.cjs. Compare with the recorded input, output and HTML. The test uses the homepage callback with a minimal DOM. It does not use Claude output or test statistical watermark detection.

See the CommonMark specification and another measured Markdown case.