Close leftover panel tabsets when knitr chunks error - #104
Open
maxkarlsson wants to merge 1 commit into
Open
Conversation
Track panel-tabset depth in open_tabset()/close_tabset() and register a knitr chunk hook that emits missing closing fences if a chunk fails after opening a tabset, so later report sections still parse. Co-authored-by: max.karlsson <max.karlsson@pixelgen.com>
maxkarlsson
marked this pull request as ready for review
September 4, 2026 15:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When the Experiment Summary is rendered with chunk error tolerance, a failed chunk could leave a Quarto
{.panel-tabset}fence unclosed. That leaked into later markdown and broke the rest of the report.This change tracks tabset depth in
open_tabset()/close_tabset(), closes leftover fences fromtabset_plotlist()/tabset_nested_plotlist()on error, and registers a knitr chunk hook that appends any missing:::fences if a chunk fails after opening a tabset.Report setup calls
register_tabset_chunk_hooks()..qmdchunks that used tocat()the opening fence now callopen_tabset().Type of change
How Has This Been Tested?
stop()s still emits a closing fence before later markdown.tabset_plotlist/tabset_nested_plotlistcapture.output expectations are unchanged.R is not available in this Cloud Agent environment, so tests were not executed here. Please run
devtools::test()/ R CMD check in CI.PR checklist: