-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Different behaviors when generating Markdown links for headings containing punctuations and other symbols #19745
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
Comments
Can you push that file to GitHub as well to see how they do it? |
Here's the repo. The behaviour seems to be the same. EDIT: I imported the repo from try.gitea.io, I didn't create one from scratch. I don't know if it makes any difference. |
I would say it's more like a There are various characters would be removed&replaced during URL generation. For example, the single quote
Since there is no standard, so there is no right or wrong, as long as it works. Maybe the answer to the question could be: if there is a definition in CommonMark, then make upstream |
I tried to search on CommonMark and I didn't find anything related to this matter. I think it's a free different choice made by goldmark and markdown-it. I'll format my links according to what goldmark does, since it's more important for me that they are working on Gitea rather than on VSCode md preview. |
Thank you for your confirmation. Since there is no standard, I think we can close this issue at the moment, until there are some standards in the future (I believe that on that day, there will be new issues for it) |
Description
When you use double quotes in a heading, Gitea removes them from the reference link.
Example:
If you use a header with double quotes like:
## Header with "double quotes"
Gitea generated link to that header is
<URL>#header-with-double-quotes
instead of<URL>#header-with-"double-quotes"
.This behaviour leads to inconsistency between renderers, even between those which follow CommonMark specs. For example VSCode's Markdown preview (which follows CommonMark specs) keeps the double quotes in the links.
I reproduced the issue here
Gitea Version
1.16.8
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
Irrelevant
Operating System
Ubuntu 20.04
How are you running Gitea?
The instance runs on a virtual machine without containerization. I don't know which DB is used since I didn't installed it myself. By the way I don't think it's relevant here.
Database
No response
The text was updated successfully, but these errors were encountered: