Skip to content

Commit

Permalink
refactor: don't generate empty block
Browse files Browse the repository at this point in the history
  • Loading branch information
Seasawher committed Apr 2, 2024
1 parent daad84f commit 059dc77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Mdgen/ConvertToMd.lean
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ private def buildBlocks (lines : List String) : List Block := Id.run do
panic!
"Nested lean commentary sections not allowed in:\n" ++
s!" line {i+1}: {line}"
blocks ++= [{content := content.trim, toCodeBlock := toCodeBlock}]

if content != "" then
blocks ++= [{content := content.trim, toCodeBlock := toCodeBlock}]
toCodeBlock := ! toCodeBlock
content := line ++ "\n"

Expand Down

0 comments on commit 059dc77

Please sign in to comment.