vscode-markdown: Links to headings with emoji code may be broken
What is the problem?
When an emoji is present in the heading, that heading will have the url broken because the extension will completely strip the emoji out of it, instead of including without the colon.
I could disable the updateOnSave
feature and manually change the URLs, but that wouldn’t prevent from erasing all my changes if i accidentally update it (since i’m used to it 😢).
How can I reproduce it?
- Create a file with the following text:
# :book: This won't work
# This won't work either :smile:
# This will
- Place the cursor at the start of the first line
- Press <kbd>Ctrl</kbd> +<kbd>Shift</kbd> + <kbd>P</kbd>
- Search for
Markdown All in One: Create Table of Contents
and click on it
As you can see the emojis are stripped out of the link, where they should be present but without the colon.
I created a sample gist containing the lines i mentioned before.
Is there any error message in the console?
No
Thank you for your great work 😄
Best Regards, Luca
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (6 by maintainers)
Commits related to this issue
- 🐛 a tmp fix for #792 — committed to yzhang-gh/vscode-markdown by deleted user 4 years ago
- 🐛 Fix the `github` slugify mode (#792) ## Summary This commit combines `baec028fcbb0a807da23aeb847ee8e4b539643c0` to `cadab204c2f28ae935498f1dddb5fdc4e3f72766`, and `f9fea764f89cc490f01e890d0a59041... — committed to Lemmingh/vscode-markdown by Lemmingh 4 years ago
- 🐛 Fix the github slugify mode (#792) (#817) ## Summary * ⬆ Update dependencies * Enable new language features: * ts-loader: 6.2.2 -> 8.0.3 * typescript: 3.5.2 -> 4.0.2 * Improve H... — committed to yzhang-gh/vscode-markdown by yzhang-gh 4 years ago
Thanks for answering so quickly! With emojis I meant GitHub’s recognized emoji code and yes, my
slugifyMode
is set togithub
.This input:
yields the following TOC in version 2.8 and lower (this is the expected output):
However, in version 3+, the TOC looks as follows (the emoji code is no longer converted, but simply removed - the links are now broken):
Thank you all for the information.
Here is the result on my PC
So if you are using
:book:
, the link does contain abook
.Can you try again with other (Markdown) extensions disabled?