You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTML header contents in markdown notebook cells not correctly populated in breadcrumbs #134853
🐛 breadcrumb preview says 'empty cell', this is apparently because the cell headers are created with HTML; if I rewrite them to be Markdown the breadcrumbs are accurate
We currently only look for markdown headers. Instead, we'd likely want to get the headers from the rendered markup. That would nicely support other types of rendered markup or extensions to the markdown rendering
This would also be a big improvement for Outline view I believe. Jupyter picks up HTML headers and adds them to the table of contents view, but in VS Code we miss out on them so the structure looks funny with some notebooks.
Pushed a fix to parse the content for h1 to h6 headers written as HTML tags. It's synchronous and performant, doesn't require the full rendering of all markdown cells either. The catch with this is we are only finding headers, the markdown cells with <p> will still be rendered as empty cells in TOC.
cc Matt Bierner (@mjbvz) what's your recommendation of improving this further more? marked plaintext renderer will skip all html tags, does it mean to get proper gist of a markdown cell, we do need to have it rendered in the webview?
Activity
vscode-triage-bot commentedon Oct 12, 2021
Pinging
notebooktopic followers: Claudia Regio (@claudiaregio) Rich Chiodo (@rchiodo) Jim Griesmer (@greazer) Don Jayamanne (@DonJayamanne) jilljac (@jilljac) Ian Huff (@IanMatthewHuff) Paige Bailey (@dynamicwebpaige)mjbvz commentedon Oct 12, 2021
Here's the relevant code:
vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts
Line 416 in 5c8ba90
We currently only look for markdown headers. Instead, we'd likely want to get the headers from the rendered markup. That would nicely support other types of rendered markup or extensions to the markdown rendering
IanMatthewHuff commentedon Oct 13, 2021
This would also be a big improvement for Outline view I believe. Jupyter picks up HTML headers and adds them to the table of contents view, but in VS Code we miss out on them so the structure looks funny with some notebooks.
Re #134853. Support html headers in notebook outline
Re #134853. Support html headers in notebook outline (#160240)
rebornix commentedon Sep 7, 2022
Pushed a fix to parse the content for h1 to h6 headers written as HTML tags. It's synchronous and performant, doesn't require the full rendering of all markdown cells either. The catch with this is we are only finding headers, the markdown cells with
<p>will still be rendered as empty cells in TOC.cc Matt Bierner (@mjbvz) what's your recommendation of improving this further more?
markedplaintext renderer will skip allhtmltags, does it mean to get proper gist of a markdown cell, we do need to have it rendered in the webview?mjbvz commentedon Sep 7, 2022
Peng Lyu (@rebornix) Do you mean handling cases where the user has written raw html tags inside their markdown? For that we could turn on
supportHtml:vscode/src/vs/base/browser/markdownRenderer.ts
Line 192 in 48f1ece
That will let the tags through, which I think is ok so long as are only looking at the tokens and not actually rendering the resulting html