From f40f1853a4be75bba290658d488099431f2a5d36 Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Mon, 14 Sep 2026 15:33:08 +0100 Subject: [PATCH] Remove dead S_advance_offset call on closing code fences The call advanced parser->offset from its current position rather than from parser->first_nonspace, so the resulting offset was wrong for an indented or nested closing fence. The value is never read: finalize takes end_column from parser->curline.size or parser->last_line_length, and the caller goes straight to the end of the line, which uses input.len. Remove the call rather than correct the arithmetic. Closes #590 --- src/blocks.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/blocks.c b/src/blocks.c index 8ff339ee4..57992a04b 100644 --- a/src/blocks.c +++ b/src/blocks.c @@ -842,7 +842,6 @@ static bool parse_code_block_prefix(cmark_parser *parser, cmark_chunk *input, // closing fence - and since we're at // the end of a line, we can stop processing it: *should_continue = false; - S_advance_offset(parser, input, matched, false); parser->current = finalize(parser, container); } else { // skip opt. spaces of fence parser->offset