Skip to content

Allow ::: without preceding empty line to be parsed as closing div - #875

Merged
vezwork merged 3 commits into
quarto-dev:mainfrom
jkrumbiegel:jk/fix-executable-blocks
Jan 6, 2026
Merged

vezwork merged 3 commits into
quarto-dev:mainfrom
jkrumbiegel:jk/fix-executable-blocks

Conversation

@jkrumbiegel

Copy link
Copy Markdown
Contributor

Fixes #521

I dug into this issue (with the help of Claude) and it turned out that the div plugin didn't see the closing ::: fences at all. So in principle what all the downstream code got was a huge nested structure of divs, never getting closed. This could then swallow up code blocks, making them appear just as normal markdown paragraphs and not executable ones (they never even got registered as code blocks). Apparently adding paragraph to div's alt entry lets ::: without preceding newlines be matched as div fences again instead of paragraph content. For me this fixed all of the examples I could try from #521 (except the as I now understand unrelated math one with inline $$).

@jkrumbiegel jkrumbiegel changed the title Allow ::: without preceding empty line to be parsed as closing div Allow ::: without preceding empty line to be parsed as closing div Dec 19, 2025
@cderv
cderv requested a review from vezwork December 22, 2025 10:31

@juliasilge juliasilge left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much, @jkrumbiegel! I added a few tests and updated the CHANGELOG; we can wait for @vezwork to take a look next week before merging.

Super glad that you dug into this! 🙌

@vezwork vezwork left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read the issue. I looked at the fix. I read the markdownit docs a bit, I still don't totally understand the fix, but it sounds good that it resolves all the code block problems from the issue. I ran the tests locally and looked at the test code and test qmd file and it looks great. Nice work.

@vezwork
vezwork merged commit 0857782 into quarto-dev:main Jan 6, 2026
2 checks passed
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.

VS Code: Problem with identifying code chunk in the presence of complex structure

3 participants