question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GitLab TOC support

See original GitHub issue

Hello! 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

### Настраиваем Доступ к Сети
  1. 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
  1. 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
  1. 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:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
BeeeWallcommented, Apr 19, 2020

I’ll take a look at doing that, then.

1reaction
BeeeWallcommented, Apr 19, 2020

I’d be willing to take a crack at it.

I suppose githubCompatibility could be changed to something like slugifyMode, with the options github, 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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found