Collapsing slides in code editor in a quarto reveal.js presentation

I am preparing a presentation in a quarto *.qmd file, with output format as reveal.js. In the code editor I can collapse each slide (clicking on the sidebar of row numbers). But this works only up to slide 18. On that slide, the collapse includes all the remaining slides to the end of the presentation. As if Positron stops recognizing the ## markdown slide separator.

If I open the same *.qmd in RStudio, I can collapse each slide separately, as expected.

Any suggestions how to revert to the expected "slide-by-slide" collapse are welcome.

Are you maybe missing some whitespace around that slide? Like perhaps a missing newline around the ## header?

If not, an example Quarto file that demonstrates this problem would be super helpful for us to understand what may be going on!

Hi @julia , thanks for responding.
I went thru my qmd file again, no newlines missing.

Below is a sample qmd that shows the same funny behaviour. I can collapse all slides in the code editor individually up to 21. Then collapsing 21 "takes" all the remaining slides and collapses them together as one.

This does not affect the compiled reveal.sj html, BTW. The final slides appear as expected. The prob is only in the code editor.

Regards,
Micha

---
title: "Collapse slides test"
format: 
    revealjs:
        theme: beige
        controls-layout: bottom-right
        showSlideNumber: 'all'
        slide-number: true
title-slide-attributes:
  data-background-image: figures/the_ark.jpg
  data-background-size: contain
  data-background-opacity: "0.8"
bibliography: major_floods.bib
---

## Slide 1

:::{style="text-align: center;"}
Hello 1
:::

## Slide 2

:::{style="text-align: center;"}
Hello 2
:::

## Slide 3

:::{style="text-align: center;"}
Hello 3
:::

## Slide 4

:::{style="text-align: center;"}
Hello 4
:::


## Slide 5

:::{style="text-align: center;"}
Hello 5
:::

## Slide 6

:::{style="text-align: center;"}
Hello 6
:::

## Slide 7

:::{style="text-align: center;"}
Hello 7
:::

## Slide 8

:::{style="text-align: center;"}
Hello 8
:::

## Slide 9

:::{style="text-align: center;"}
Hello 9
:::

## Slide 10

:::{style="text-align: center;"}
Hello 10
:::

## Slide 11

:::{style="text-align: center;"}
Hello 11
:::

## Slide 12

:::{style="text-align: center;"}
Hello 12
:::


## Slide 13

:::{style="text-align: center;"}
Hello 13
:::

## Slide 14

:::{style="text-align: center;"}
Hello 14
:::

## Slide 15

:::{style="text-align: center;"}
Hello 15
:::

## Slide 17

:::{style="text-align: center;"}
Hello 17
:::

## Slide 18

:::{style="text-align: center;"}
Hello 18
:::

## Slide 19

:::{style="text-align: center;"}
Hello 19
:::

## Slide 20

:::{style="text-align: center;"}
Hello 20
:::

## Slide 21

:::{style="text-align: center;"}
Hello 21
:::

## Slide 22

:::{style="text-align: center;"}
Hello 22
:::

## Slide 23

:::{style="text-align: center;"}
Hello 23
:::

## Slide 24

:::{style="text-align: center;"}
Hello 24
:::

## Slide 25

:::{style="text-align: center;"}
Hello 25
:::


## Slide 26

:::{style="text-align: center;"}
Hello 26
:::

## Slide 27

:::{style="text-align: center;"}
Hello 27
:::

## Slide 28

:::{style="text-align: center;"}
Hello 28
:::

## Slide 29

:::{style="text-align: center;"}
Hello 29
:::


## Slide 30

:::{style="text-align: center;"}
Hello 30
:::

## Slide 31

:::{style="text-align: center;"}
Hello 31
:::

## Slide 32

:::{style="text-align: center;"}
Hello 32
:::

Thank you so much for this example! I added it to VS Code: Problem with identifying code chunk in the presence of complex structure · Issue #521 · quarto-dev/quarto · GitHub, where we tracking a number of similar problems with the editor not correctly recognizing the structure of a .qmd. We have some work in progress that should improve the situation soon!

Thanks for the update. I'll follow along as this progresses.