Skip to content

Commit 5a48b37

Browse files
committed
ensure we flush code cells when they are back to back
1 parent de824f6 commit 5a48b37

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/resources/filters/quarto-pre/code-annotation.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,11 @@ function code()
422422
-- don't process code cell output here - we'll get it above
423423
if not block.attr.classes:find('cell-code') then
424424

425+
if pendingCodeCell then
426+
outputBlock(pendingCodeCell)
427+
clearPending()
428+
end
429+
425430
local cellId = resolveCellId(block.attr.identifier)
426431
local codeCell = processCodeCell(block, cellId)
427432
if codeCell then
@@ -502,6 +507,11 @@ function code()
502507
else
503508
outputBlockClearPending(dl)
504509
end
510+
else
511+
if pendingCodeCell then
512+
outputBlock(pendingCodeCell)
513+
end
514+
clearPending();
505515
end
506516
else
507517
outputBlockClearPending(block)

0 commit comments

Comments
 (0)