Skip to content

Backslash escapes render as markup and escaped br text is lost on visual save #76

Open

Description

@BinaryOutlook

Problem

Backslash-escaped punctuation is interpreted as markup in the visual editor. An escaped literal <br> becomes a line break and the literal tag text is removed from the outgoing save payload after an unrelated edit. Escaped asterisks also appear as emphasis, although their source survived this probe.

Reproduction

Literal \<br> tag

Tail
  1. Open this synthetic file in the visual editor.
  2. Add ! to Tail without changing the first paragraph and save.
  3. Compare the first paragraph with the original source.

Observed: the first paragraph contains a real <br> DOM node, and the outgoing save is Literal \ tag followed by the edited tail. The literal <br> text is lost. Separately, \*literal\* renders an <em> element; its original source did survive the unrelated edit/save in this test.

Expected: escaped punctuation renders literally and an unrelated edit preserves the content. CommonMark explicitly treats \<br/> as text and escaped asterisks as non-emphasis: https://spec.commonmark.org/0.31.2/#backslash-escapes.

Evidence and scope

Reproduced with the freshly generated standalone Chromium editor from clean main commit 41ea238a99aea72b197fa33dc1001bd9ef09a0e5 (package version 0.4.0) on macOS arm64. The probe captured the DOM, immediate round trip, and host edit/save payload after an unrelated visual edit. Installed VS Code, Electron, and exports were not tested for these inputs.

The inline parser in src/webview/editor.js handles <br> and emphasis without first preserving backslash-escape semantics. Please cover escaped HTML-like text, emphasis markers, links, code delimiters, and source/visual save round trips; prioritize the confirmed text loss.

Activity

  1. added
    bug
    on Sep 25, 2026
  2. BinaryOutlook commented on Sep 27, 2026

    @BinaryOutlook
    OwnerAuthor

    PR #80 audit update: escaped syntax still renders incorrectly

    Remaining P2 behavior: escaped emphasis and escaped literal <br> still render as markup on ffbdad524d393aa783760f4829cb995d8b9d6405. The tested candidate preserves these source bytes, so distinguish the remaining rendering defect from the original baseline save-loss observation.

    Inputs tested separately:

    Literal \*stars\* text
    Literal \<br> text

    Open visually and append ! at the paragraph's end. Observed: the asterisks still generate emphasis and escaped <br> still produces a real break. The captured save messages retain Literal \*stars\* text! and Literal \<br> text! respectively. That retained spelling does not make the display literal or correct.

    Evidence: 2026-09-27, unmodified #80 production fixture, Node 24.21.0 / Chrome 154.0.8037.57 on macOS ARM64; real keyboard edits, outgoing host save messages and simulated reopening. No new installed-host or export-reader result is claimed for these exact inputs. Keep literal rendering and source preservation as separate acceptance assertions. The relevant path remains parseInline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions