yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.93k stars 325 forks source link

Update slugify method for Azure DevOps TOC generation #1382

Closed PHLUNK closed 10 months ago

PHLUNK commented 10 months ago

Hi yzhang,

I have updated the slugify method for Azure DevOps used when generating/updating a TOC in a markdown file. For most headers, it will keep working, but simultaneously non-UTF8-encoded readable slugs. I have read #802, and unfortunately, TOC entries starting with numbers remain problematic and are generally rendered as references to work items in Azure DevOps markdown render. Therefore, the original slugify method is only used to fully encode these using the original slugify method, which produces working references, albeit far-less readable for us humans.