Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GitLab slugs to TOC (Closes #469) #660

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

BeeeWall
Copy link
Contributor

This removes the githubCompatibiity option, replacing it with slugifyMode. Unfortunately, while I originally tried to make it automatically set the latter based on the former, I couldn't figure out a way to actually "delete" the setting (setting it to undefined doesn't seem to work, though it says it should), and as such any changes to slugifyMode would always be overridden by githubCompatibility. So I had to settle for just removing it (unless someone else knows how to do that right?)

@BeeeWall
Copy link
Contributor Author

Is there a reason the slugify tests don't call mdHeadingToPlainText before calling slugify? (I spent an embarrassingly long time trying to figure out why GitLab gave a different link from my code [well, my replication of their code], before I realized it was that they strip syntax first and the tests don't lol)

Also, I've updated .tsconfig to use ES2018, as the minimum version of VS Code you put should support it, and this allows replacing that couple-thousand-character punctuation regex that had been in there.

@BeeeWall BeeeWall changed the title Add support for GitLab slugs to TOC Add support for GitLab slugs to TOC (Closes #469) Apr 20, 2020
@BeeeWall
Copy link
Contributor Author

Along the way, I also discovered GitLab has their own feature for Table of Contents (putting [[_TOC_]] will insert one when rendered in GitLab).

I'm not sure if that's relevant to this extension in any way or not, but it may be useful for anyone who stumbles across this, I suppose.

@yzhang-gh
Copy link
Owner

Thanks a lot!

This removes the githubCompatibiity option, replacing it with slugifyMode.

No worries. We can pop up a warning if people have enabled githubCompatibility. I'll do it later.

Is there a reason the slugify tests don't call mdHeadingToPlainText before calling slugify?

vscode mode doesn't do mdHeadingToPlainText so we need to put it inside slugify function.

Also, I've updated .tsconfig to use ES2018, as the minimum version of VS Code you put should support it, and this allows replacing that couple-thousand-character punctuation regex that had been in there.

Interesting! Nice change.

Along the way, I also discovered GitLab has their own feature for Table of Contents (putting [[_TOC_]] will insert one when rendered in GitLab).

We can mention this in the original issue. From technical perspective, it is doable microsoft/vscode#85682 (comment). But maybe we don't need it now.

@yzhang-gh yzhang-gh merged commit 67fcde9 into yzhang-gh:master Apr 21, 2020
@Lemmingh Lemmingh linked an issue Dec 20, 2020 that may be closed by this pull request
@Lemmingh Lemmingh added Area: Configuration Requiring changes in configuration schema. Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations). Area: Meta Pertaining to build system, test system, infrastructure, code health, and the project itself. labels Dec 20, 2020
@Lemmingh Lemmingh added the Area: Link (Reserved) Markdown link processing, URI recognition, slugification. label Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Configuration Requiring changes in configuration schema. Area: Link (Reserved) Markdown link processing, URI recognition, slugification. Area: Meta Pertaining to build system, test system, infrastructure, code health, and the project itself. Area: Table of contents Pertaining to table of contents (TOC generation and detection, related heading operations).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitLab TOC support
3 participants