quarto-dev / quarto-dev/quarto
Folding Fails When Divs Contain Headings
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
Bug description
(reposted from https://github.com/posit-dev/positron/issues/11625)
Folding breaks when a Quarto document contains headings inside div blocks.
Steps to reproduce
- Open a Quarto (.qmd) file in Positron
- Add the code sample below
- Attempt to fold ### Heading B
Test Code:
## Test
Testing, testing, ... 🎤
### Heading A
Fabio vel iudice vincam, sunt in culpa qui officia. Inmensae subtilitatis, obscuris et malesuada fames. Ambitioni dedisse scripsisse iudicaretur. Nec dubitamus multa iter quae et nos invenerat. Petierunt uti sibi concilium totius Galliae in diem certam indicere.
### Heading B
Petierunt uti sibi concilium totius Galliae in diem certam indicere. Morbi fringilla convallis sapien, id pulvinar odio volutpat. A communi observantia non est recedendum.
::: {#thm-line}
## Line
The equation of any straight line can be written as:
$$
y = mx + b
$$
:::
#### Another Heading
Cum sociis natoque penatibus et magnis dis parturient. Curabitur blandit tempus ardua ridiculus sed magna. Salutantibus vitae elit libero, a pharetra augue.
Actual behavior
Folding does not work correctly when headings appear inside div blocks.
Expected behavior
Folding should work correctly regardless of whether headings appear inside div blocks.
Your environment
Positron Version: 2026.02.0 build 139
Code - OSS Version: 1.106.0
Commit: 4b472e9bf40ca88f886fe9c7fcfbb9ee702fccd0
Date: 2026-01-29T04:47:19.126Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Linux x64 6.18.7-arch1-1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied .qmd example in Positron and observe folding for Heading B and the heading inside the div block. Trace the folding behavior from the Quarto document handling used by the editor. Done means headings fold correctly whether or not they appear inside div blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100