Pass ordered-list start through custom renderer#643
Merged
Conversation
marked 4's Renderer.list signature is list(body, ordered, start), but the custom override dropped start and called super.list(body, ordered). With start undefined, marked emits <ol start="undefined"> for every ordered list — invalid HTML (browsers ignore it, so numbering still displays 1,2,3), and lists written to start at a number other than 1 (e.g. "7.") were renumbered from 1. Accept and forward start. Ordered lists starting at 1 now render a clean <ol>, and a list starting at 7 renders <ol start="7"> as written. The task-list special-case is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
joehoyle
approved these changes
Jun 1, 2026
kadamwhite
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Content impact
Affects numbered (ordered) lists in posts.
<ol start="undefined">in the HTML (browsers ignore it).7.8.9.) had its start dropped and renumbered from 1.Cause
marked 4's
Renderer.listsignature islist(body, ordered, start). The custom override insrc/compile-markdown.jswas written for the old (marked 0.3)list(body, ordered)signature and calledsuper.list(body, ordered), sostartwas alwaysundefined.Fix
Accept and forward
start. Ordered lists starting at 1 now render a clean<ol>; a list starting at 7 renders<ol start="7">as written. The task-list special-case is unchanged. Verified by rendering samples through marked 4.3.0.Targets
mainso the release Action rebuilds the bundle on merge.🤖 Generated with Claude Code