huntertran / markdown-toc

Auto MarkdownTOC (Table Of Contents) plugin for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=huntertran.auto-markdown-toc
MIT License
39 stars 25 forks source link

Limit TOC header processing to string symbols #62

Closed vamsi-juvvi closed 1 year ago

vamsi-juvvi commented 1 year ago

Fix for Issue #60

The main issue was that inclusion of the @ symbols in plantuml code blocks made vscode.executeDocumentSymbolProvider return a strange/mistaken symbol with an unexpected kind: symbok.kind = SymbolKind.Object which messed up TOC generation.

Since Markdown headers are expected to only be strings, filter the symbols at their generation point and limiting them to strings seemed to be the simplest clean change. This is done in HeaderManager.ts in function getDocumentSymbols.

While testing the updated extension locally, I ran into packaging issues: vsce no longer allows svg images from https://vsmarketplacebadge.apphb.com. Updated online instructions ask to use https://vsmarketplacebadges.dev instead. Some additional misc changes were also made.

Testing