Skip to content

Preserve literal markup and meaningful padding inside inline code #84

Closed

Description

@BinaryOutlook

Inline code examples can change meaning when their containing paragraph is edited: literal <br> becomes a break, and code-span padding shrinks across save/reopen. Preserve the code payload's literal semantics through parsing and serialization.

Priority: P2 / Medium — code-content correctness. Both cases were reproduced on #80 and baseline 41ea238a99aea72b197fa33dc1001bd9ef09a0e5.

Reproduction and findings

Literal markup

Code `<br>` tail

Open visually and append ! to tail. Observed: the literal code is rendered as a break, and the outgoing save message contains Code <br> tail! without code delimiters. Expected: <br> remains literal code.

Meaningful padding

Code `  Alpha  ` tail

Open visually, append ! to tail, save and reopen through the renderer. Observed: the initially rendered code has one leading/trailing content space; serialization writes only one space inside each delimiter, so reopening removes those content spaces. Expected: the rendered code payload stays stable; normalization must not progressively shrink it.

Scope and acceptance criteria

  • Protect code spans before interpreting HTML-like breaks or other inline markup.
  • Serialize padding and delimiters so reopening preserves the original code payload.
  • Cover markup-like content, padded/all-space spans, embedded backticks and repeated round trips.
  • Test edits inside the containing paragraph, unrelated-block edits, undo/redo, Source mode, and native save/reopen.

Keep this slice focused on inline code. Backslash escapes remain in #76; fenced-block behavior is a regression boundary rather than a requested redesign.

Source evidence

See inline break handling, code-span padding handling, and code serialization.

Build identity and verification boundary

Recorded during the 2026-09-27 audit of #80 at ffbdad524d393aa783760f4829cb995d8b9d6405 (package version 0.4.0), using Node 24.21.0 on macOS ARM64. The tested product source was unmodified. This is an unreleased development snapshot.

Reproduced in Chrome 154.0.8037.57 through the production editor fixture, real keyboard edits, captured host save messages, and simulated reopening. This establishes rendered/outgoing-Markdown behavior; this exact case was not verified through an installed VS Code filesystem save or export readers.

Reproduce and validate changes using the checkout's build guide and testing guide. Keep evidence synthetic and sanitized.

Activity

  1. added
    bug
    on Sep 27, 2026
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