If you have a heading inside a block of Markdown code, you can't collapse the block of code

Steps to reproduce

  1. Copy this text:
## Test

Test

```markdown
# Test
```
  1. Collapse the ## Test heading in live preview mode

Did you follow the troubleshooting guide? [Y/N]

Yes

Expected result

image_1

Actual result


Additional information

My version is 1.12.7. I tested it on a new vault without any plugins, snippets, or themes