-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Issue and pull request references unexpectedly interpreted as headings #3189
Comments
I just read in issue #3231 that Gitea is using Blackfriday as a Markdown processor. Is this issue something I should file in the Blackfriday repository instead? I still think it would be best to follow the Commonmark specification, but I’m not sure whether Blackfriday adheres to this standard. |
Not really as issue/PR linkng is happening in gitea side |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Just to keep this issue from being discarded by the stale bot, I can still reproduce this behavior on Gitea 1.7.3. I think it would be good to have Gitea’s interpretation of Markdown match GitHub’s. I’d be willing to work on this, but I’m pretty busy with other things at the moment. @lafriks: Can you elaborate what you mean by “PR linking is happening in Gitea side”? That’s what I would expect, can’t it be changed? |
Just that changes need to be done in Gitea code not in blackfriday library |
When using lists of issues, they are also sometimes interpreted as headings but not always as demonstrated in this example: https://try.gitea.io/samurous/markdown_test/src/branch/master/README.md Here * #1 My 1st Issue.
* #2 My 2nd Issue.
* A new List.
* With another point. It seems only the last point will be rendered as a heading. |
Issue still present in |
This can be closed as it was fixed when we migrated out of blackfriday. https://try.gitea.io/guillep2k/charset-problem/issues/2#issuecomment-25596 |
@guillep2k: How cool, thanks for pointing this out! |
[x]
):Description
When writing issue or pull request comments, lines that start with a
#
character are unconditionally rendered as headings. This takes precedence over interpreting the#
character as the beginning of an issue or pull request reference such as #3189. This was unexpected for me, because I sometimes start sentences with an issue or pull request ID.Consider the following comment in Markdown:
This is rendered by Gitea as follows:
Note that the same text is treated very differently by GitHub:
The reason for the difference seems to be that GitHub only considers lines starting with
#
as headings if the#
is separated from the text by at least one whitespace.I guess that GitHub shouldn’t serve as the only source of truth in such decisions. However, quoting CommonMark as a more objective source:
I think that this specification detail is reasonable, considering the examples mentioned above in the CommonMark document as well as the use of
#
for referencing issues and pull requests. For this reason, I suggest adjusting Gitea’s Markdown implementation for consistency with CommonMark.The text was updated successfully, but these errors were encountered: