Skip to content

fix: do not include leading file contents in blog genre lean blocks as whitespace - #924

Merged
david-christiansen merged 1 commit into
leanprover:mainfrom
whxvd:fix-blog-lean-block-parsing
Jul 27, 2026
Merged

fix: do not include leading file contents in blog genre lean blocks as whitespace#924
david-christiansen merged 1 commit into
leanprover:mainfrom
whxvd:fix-blog-lean-block-parsing

Conversation

@whxvd

@whxvd whxvd commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

leanprover/lean4#12662 changed the module parser to by default include the text preceding the first token in a Lean file as whitespace belonging to that token. That parser infrastructure also is used for lean blocks in the blog genre. The change in the PR had the effect that the first lean block for an exampleContext always included the whole preceding Verso file contents as leading whitespace at the first command token.

Fixes #923.

… as whitespace

leanprover/lean4#12662 changed the module parser
to by default include the text preceding the first token in a Lean file
as whitespace belonging to that token. That parser infrastructure also
is used for `lean` blocks in the blog genre. The change in the PR had
the effect that the first `lean` block for an `exampleContext` always
included the whole preceding Verso file contents as leading whitespace
at the first command token.

See https://leanprover.zulipchat.com/#narrow/channel/576452-verso/topic/Text.20rendering.20twice/with/608642094
for screenshots.
@david-christiansen
david-christiansen added this pull request to the merge queue Jul 27, 2026
@david-christiansen

Copy link
Copy Markdown
Collaborator

Thank you!

Merged via the queue into leanprover:main with commit a62b9fa Jul 27, 2026
13 checks passed
david-christiansen pushed a commit that referenced this pull request Aug 7, 2026
… as whitespace (#924)

leanprover/lean4#12662 changed the module parser
to by default include the text preceding the first token in a Lean file
as whitespace belonging to that token. That parser infrastructure also
is used for `lean` blocks in the blog genre. The change in the PR had
the effect that the first `lean` block for an `exampleContext` always
included the whole preceding Verso file contents as leading whitespace
at the first command token.

Fixes #923.
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.

First Lean codeblock is corrupted

2 participants