-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Closed
Description
Description
When editing a Markdown document with YAML front-matter, the Table of Contents shows only the last item of frontmatter.
Reproduce
-
Open the Launcher
-
Click on Markdown File
-
Open the Table of Contents sidebar
-
Add a header
# Hello World
-
See Hello World in the Table of Contents
-
Add some YAML front matter before the header
--- foo: bar boo: baz --- # Hello World
-
See only
boo: baz
in the Table of Contents
This was found while working on a JEP in JupyterLab.
By adding a newline above the second ---
, the problem also goes away, so presumably it's treating that last item as an h2
which counterfeits everything below it.
Expected behavior
- Definitely see all the headers
- Maybe see a collapsible table above/below the rest of the items
- but definitely not worth adding/faking a YAML parser
- maybe just a chunk of YAML-formatted code (e.g. if the first line starts with
[^:]+:
Context
- Operating System and version: Linux Ubuntu 21.04
- Browser and version: Chromium 110
- JupyterLab version: 4.0.0a39 (+ Update to marked 7.0.2, add mermaidjs 10.3.1 #14102)