Skip to content

Commit a62b9fa

Browse files
authored
fix: do not include leading file contents in blog genre lean blocks 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.
1 parent 461db9a commit a62b9fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/verso-blog/VersoBlog.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ meta def lean : CodeBlockExpanderOf LeanBlockConfig
488488
-- Process with empty messages to avoid duplicate output
489489
let s ←
490490
withTraceNode `Elab.Verso.block.lean (fun _ => pure m!"Elaborating commands") <|
491-
IO.processCommands context { state with pos := startPos } { commandState with messages.unreported := {} }
491+
IO.processCommands context { state with pos := startPos, hasLeading := false } { commandState with messages.unreported := {} }
492492
for t in s.commandState.infoState.trees do
493493
pushInfoTree t
494494

0 commit comments

Comments
 (0)