-
Notifications
You must be signed in to change notification settings - Fork 329
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 gitea slugification #763
Conversation
The previous commit messed up with the gitlab and gitea tests
Thanks for the PR. I'm okay with this as you already implemented it. As for the failed test, you can make a document |
Sorry for the forced push, I was trying to hide my mistakes... Anyway, the tests are shown as not okay, but I tried triggering them on my repository and everything is okay. I don't know if you can run them again. |
Mmh the tests keep failing on this repository. See the pull request on my fork : https://github.com/rodolpheh/vscode-markdown/pull/4 |
Well, that's strange. Let me just merge it in. |
All set. 🍻 |
For future references, I think that gitea uses blackfriday for parsing and sanitizing the markdown, here is an explanation of the algorithm used for anchor sanitation in blackfriday. |
Gitea has migrated to goldmark with their own slugify method since version 1.11 released on 2020-02-10.
I hope the info above is useful to you. |
👍. Just to leave a reminder for myself here, Hugo also uses goldmark (#689 (comment)). |
Woah this is great information, thank you very much. For now, I have improved the gitea slugification to follow more closely the blackfriday algorithm (see #764). It seems to work with a few exotic values and hopefully will work for most of the cases. |
For reference and if I'm not mistaken, this is the default goldmark function called for generating the IDs : |
When generating TOC, the links are not properly slugified for Gitea. One of the issues I had was that Gitea expect all underscores to be hyphen.
This is a quick hack, I'm still missing the source for the slugification function of Gitea so I'm not sure all the proper changes are made when slugifying. Also the tests probably doesn't cover every cases.