Skip to content

Ordered lists with a non-1 start render and save from 1 #75

Closed

Description

@BinaryOutlook

Problem

An ordered list whose first marker is greater than 1 displays from 1 in the visual editor. An unrelated visual edit then produces a save payload starting from 1, changing authored numbering.

Reproduction

Use this synthetic source in Binary Markdown's visual editor:

5. five
6. six

Tail
  1. Observe the displayed list numbers.
  2. Add ! to Tail without editing the list and save.
  3. Inspect the outgoing Markdown or the file after a native save.

Observed: the DOM contains <ol> without start="5", displays 1/2, and the outgoing save contains 1. five and 2. six.

Expected: the list displays from 5 and an unrelated edit preserves its start number. CommonMark assigns the list's start number from its first item: https://spec.commonmark.org/0.31.2/#lists.

Evidence and scope

Reproduced on clean main commit 41ea238a99aea72b197fa33dc1001bd9ef09a0e5, package version 0.4.0, with the freshly generated standalone Chromium editor on macOS arm64. The probe captured the rendered DOM, immediate round trip, and host edit/save payload after the unrelated edit. It did not test the installed VS Code host or other operating systems.

The parser drops the ordered marker value in src/webview/editor.js (parseMarkdownLine), the renderer starts a bare <ol>, and the serializer begins at 1. This is distinct from #5, which tracks blank-line-separated continuation paragraphs splitting a list.

Suggested regression coverage: first markers 0, 5 and 10; nested and separate ordered lists; view-only open; unrelated edit/save/reopen; source switching. The exact spelling of later markers can be normalized, but the initial start number affects meaning.

Activity

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

    @BinaryOutlook
    OwnerAuthor

    PR #80 audit progress: a plain ordered list now retains its start

    A plain ordered-list case passed on ffbdad524d393aa783760f4829cb995d8b9d6405 during the 2026-09-27 audit:

    5. Five
    6. Six

    After appending ! to Six, the editor retained <ol start="5">, emitted 5. Five followed by 6. Six!, and preserved the ordered start when reopened through the renderer.

    Evidence: unmodified production browser fixture, Chrome 154.0.8037.57 / Node 24.21.0 on macOS ARM64; real keyboard edit, outgoing save message and simulated reopen. This specific probe edited the second list item; it does not independently cover every unrelated-tail, zero-start, nested-list, native-save or platform case from the issue.

    Keep this as bounded candidate progress, not an automatic closure or release claim. Ordered checkbox lists still change to bullets after editing and are tracked in #82; that failure should not be hidden by the passing plain-list case.

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