-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[Bug] Markdown #10326
Comments
The markdown parser we use must not allow |
Have you tried & g t ; ? |
To be honest I don't see difference between github and gitea rendered tables 🤔 |
Maybe that's the case but why would it be allowed here on github then?
That did not work ether, but it works here on github as well.
The broken one don´t show you the tooltip in "try.gitea.io" when you hover over it. |
GH uses a different parser than us, more than likely. I haven't had a chance to look for a possible config option, but my guess is we would need to extend our parser for this to work. |
It took me a while to understand the problem 😁. For reference: GitHub, mouse hover on first item:GitHub, mouse hover on second item:Gitea, mouse hover on first item:Gitea, mouse hover on second item:@TimerWolf since we can't access the exact markdown code you've used, would you paste it here in a code block?
|
[Works](https://: "1, 2 ,3, 4, 5")
[Broken](https://: "1< 2 -> 3 -> 4 -> 5") Essentially this is exploiting link titles for hovering purposes. |
No luck. The parser won't even take |
This looks like an upstream bug, possibly? |
@guillep2k: thanks for straight that things out for me, for some reason when i do stuff it always end up that people don't understand what i mean. I don't know why as i was quite clear to me as i did change the code to "hover -> here" and also actually have the "status" indicator, but thanks again and sorry if anyone if it was a bit unclear. The code is back to it's original i was never suppose to change not sure why i accepted that change, it was only suppose to be a preview test that @zeripath suggested... @jolheiser: i like to use the hover for this purpose when it's a lot of text that should fit in and in the same time not break the table, like descriptions. |
This comes from default bluemonday policy and not goldmark: gitea/vendor/github.com/microcosm-cc/bluemonday/helpers.go Lines 109 to 112 in dc822d5
Then enabled for title here: gitea/vendor/github.com/microcosm-cc/bluemonday/helpers.go Lines 162 to 163 in dc822d5
If we did want to overide it and allow a closing tag for link titles we could use this in https://github.com/go-gitea/gitea/blob/master/modules/markup/sanitizer.go,
Which in testing would output:
Which seems fine in that example. I believe. You can see it currently doesn't allow other characters as well (pretty much anything that isn't a word number and those few punctuations listed) |
Shoot, I thought I tested it well enough locally. Good catch @mrsdizzie! |
@jolheiser Does that seem like something we should change you think? |
It seems that would solve this particular issue, but I'm not sure if there would be other unintended effects. Based on the comment in the bluemonday excerpt, it seems like If you test with that sanitizer, can you escape titles using raw html? |
Hmm seems fine in my probably limited testing |
As mentioned above, this is because of our sanitizer, not goldmark.
@mrsdizzie would you mind opening a PR? We can discuss whether we should include more symbols there? I'm still cautious because bluemonday specifically mentions blocking |
According to the common mark spec: https://spec.commonmark.org/0.29/#link-title You should be able to stick abut anything in there. Right now we're limited by the default setting of bluemonday which restricts what can go in a title tag and makes our rendering not compliant with the spec. This should fix go-gitea#10326
@jolheiser opened PR for further discussion |
Fixed by #10527 if not please reopen |
[x]
):Description
I think that this and the broken feature is called markdown, and if you use it this way as i do under this text it will break, for some reason it don't here at github :)
If the link provided not working, just use the code that i used here!
Example
The text was updated successfully, but these errors were encountered: