silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.01k stars 138 forks source link

Strip Markdown in TOC #887

Closed MrMugame closed 2 weeks ago

MrMugame commented 2 weeks ago

This strips the markdown in the TOC. So something like this ==FOO== gets stripped to FOO. Most notably, this also strips aliased links ([[index|Home]] -> Home) and should thus fix #867. The only problem right now is that a headline like this # Hello ] still results in ugly markdown for the same reasons as before and I frankly have no good ideas on how to fix this. (Btw. this whole "problem" also exists in Obsidian, but for them it's not that important as they don't have something like the toc plug, which programmatically renders to aliased links) I tried to allow the escaping of the closing brackets in the regex, but this then results in issues there this - [index| Foo \] Bar] gets parsed as a task. Fixing that would temper with the syntax etc. The only real other solution I can think of would be to just create the TOC in html, but that would destroy the whole look imo Soooo ... just life with it for now?

zefhemel commented 2 weeks ago

I think this is good enough as is. Thanks!