Skip to content

fix(content): keep the blank line after an indented code block - #79

Merged
delphinus merged 1 commit into
mainfrom
fix/indented-code-blank
Oct 26, 2026
Merged

delphinus merged 1 commit into
mainfrom
fix/indented-code-blank

Conversation

@delphinus

Copy link
Copy Markdown
Owner

An indented code block was followed directly by the next paragraph: the blank line between them disappeared.

Before:

    code line

After.

rendered as Before: / blank / code line / After..

Cause

The indented code path ends with goto continue, which skips the tracking at the end of the render loop. The blank line in front of the block stayed recorded as the last line rendered, so the blank line after the block was collapsed as a second blank in a row.

Change

The indented code path now records the code line itself (prev_rendered_blank = false, prev_was_heading = false).

Tests

  • tests/indented_code_test.lua: one-line and multi-line blocks keep the blank line after them. Both assertions fail without the change.
  • make test and stylua.

🤖 Generated with Claude Code

An indented code block was followed directly by the next paragraph: the
blank line between them disappeared. The indented code path jumps to the
next source line before the tracking at the end of the loop, so the
blank line in front of the block still counted as the last line
rendered, and the one after it was collapsed as a duplicate.

The path now records the code line itself.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@delphinus
delphinus merged commit a10f025 into main Oct 26, 2026
38 checks passed
@delphinus
delphinus deleted the fix/indented-code-blank branch October 26, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant