GitLab TOC support
See original GitHub issueHello! Your extension is very convenient, but there are a few issues with the TOC, generated with markdown.extension.toc.githubCompatibility=true when using with GitLab (v. 11.11.3-ee, the latest one)
The first issue is the same I described here for doctoc. The others are specific for this extension (doctoc processes them correctly).
Here is my test.md with the generated TOC:
- [MikroTik hAP ac²](#mikrotik-hap-ac²)
- [Switch + Access Point](#switch--access-point)
- [Настраиваем Доступ к Сети](#Настраиваем-Доступ-к-Сети)
## MikroTik hAP ac²
The [hAP ac²](https://mikrotik.com/product/hap_ac2) is a Dual-concurrent Access Point, that provides Wifi coverage for 2.4 GHz and 5 GHz frequencies at the same time. Five 10/100/1000 Ethernet ports provide Gigabit connections for your wired devices, USB can be used for external storage or 4G/LTE modem, and device supports IPsec hardware acceleration.
### Switch + Access Point
### Настраиваем Доступ к Сети
- The 1st entry contains a specific symbol
². I described a similar issue here. The real GitLab link for that header is
https://mydomain.tld/myrepo/test.md#mikrotik-hap-ac
- The 2nd entry. Your extension incorrectly processes the
+sign. The real GitLab link for that header is
https://mydomain.tld/myrepo/test.md#switch-access-point
- The 3rd entry. This is a Cyrillic text. Your extension does not convert upper case characters to lower case. The correct TOC entry for that header (the working one) should be
- [Настраиваем Доступ к Сети](#настраиваем-доступ-к-сети)
And the real GitLab link for that header is
https://mydomain.tld/myrepo/test.md#%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%B0%D0%B8%D0%B2%D0%B0%D0%B5%D0%BC-%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF-%D0%BA-%D1%81%D0%B5%D1%82%D0%B8
In fact, doctoc works more correctly, but your extension is much more convenient, and I love it a lot. I’d like you have corrected those issues. Thanks in advance!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Table Of Contents (TOC) in Markdown (Wiki and general)
Some markdown editors (like stackedit.io) support a [TOC] "command", ... It would be good, if the markdown engine used by Gitlab f…
Read more >GitLab Flavored Markdown (GLFM)
Add either the [[_TOC_]] or [TOC] tag on its own line to the Description field of any of the supported content types: Markdown...
Read more >Support for TOC in README files (#21901) · Issues - GitLab
How do we know it is done? Supporting Table of Contents. Does this seem like something we should support? And allow in issue...
Read more >Handbook Markdown Guide - GitLab
Table of Contents (ToC); Tables; Collapse; Code blocks ... In most of GitLab text areas you'll find markdown support.
Read more >Documentation Style Guide - GitLab Docs
GitLab adds all troubleshooting information to the documentation, no matter how unlikely a user is to encounter a situation. GitLab Support maintains their...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I’ll take a look at doing that, then.
I’d be willing to take a crack at it.
I suppose
githubCompatibilitycould be changed to something likeslugifyMode, with the optionsgithub,gitlab,vscode? (I haven’t really worked with VS Code extensions before, so I don’t know whether limiting it to specific values is possible or not, but if not, defaulting to “vscode” could work)