From 86109029f0690b000edad1355ab5a7df954fbd0e Mon Sep 17 00:00:00 2001 From: Sander van Dragt Date: Mon, 1 Jun 2026 15:05:25 +0100 Subject: [PATCH] Pass ordered-list start through custom renderer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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
    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
      , and a list starting at 7 renders
        as written. The task-list special-case is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/compile-markdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compile-markdown.js b/src/compile-markdown.js index f118e2c0..d640bd92 100644 --- a/src/compile-markdown.js +++ b/src/compile-markdown.js @@ -12,12 +12,12 @@ class CustomRender extends marked.Renderer { return super.link( href, title, text ); } - list( body, ordered ) { + list( body, ordered, start ) { if ( body.indexOf( TASK_LIST_TOKEN ) >= 0 ) { return '
          ' + body.replace( new RegExp( TASK_LIST_TOKEN, 'g' ), '' ) + '
        '; } - return super.list( body, ordered ); + return super.list( body, ordered, start ); } listitem( text ) {