Skip to content

HTML sanitizer doesn't allow centering of text #10471

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

Closed
alexanderadam opened this issue Feb 26, 2020 · 8 comments · Fixed by #10527
Closed

HTML sanitizer doesn't allow centering of text #10471

alexanderadam opened this issue Feb 26, 2020 · 8 comments · Fixed by #10527
Labels
type/enhancement An improvement of existing functionality

Comments

@alexanderadam
Copy link

alexanderadam commented Feb 26, 2020

Description

See the missing icon in the README of this mirror on try.gitea.io whereas the rendering on GitHub is flawless. (see #8830 for the image issue).

The text centering of the headline is lost.

Screenshots

Screenshot_20200226_083247

@jolheiser
Copy link
Member

The first issue is a duplicate of #8830

The second is because of our sanitizer not allowing align = "center".

@zeripath
Copy link
Contributor

If instead of writing html you used markdown syntax for the image - it would work as expected.

We don't currently munge the relative URL of a IMG elements - I guess we could and it is likely to be a very simple pr to do that.

@alexanderadam
Copy link
Author

The first issue is a duplicate of #8830

Ah I see. I searched for it and found nothing. I will remove the part about the relative path in this issue then.
Thank you for pointing out 👍

If instead of writing html you used markdown syntax for the image - it would work as expected.

  1. It isn't my repository. I just took a random repository from GitHub and mirrored it on try.gitea.io. I obviously can't control random repositories on the web. 😉
  2. So the logic between Markdown and HTML rendering is diverged (= buggy)

@alexanderadam alexanderadam changed the title Image references and text rendering is sometimes broken HTML sanitizer doesn't allow centering of text Feb 27, 2020
@zeripath
Copy link
Contributor

see #10515 for dealing with the embedded html img tags ...

@alexanderadam
Copy link
Author

Awesome, thank you Andrew!

@guillep2k guillep2k added the type/enhancement An improvement of existing functionality label Feb 28, 2020
zeripath added a commit that referenced this issue Feb 28, 2020
Looking at github/markup#245 it is clear that GH uses https://github.com/jch/html-pipeline to sanitize. This PR relaxes our sanitization to more closely match this.

Fixes #10471
and likely others...
@alexanderadam
Copy link
Author

Thank you so much for fixing those both issues, @zeripath.
I'm afraid I found another markdown/html rendering issue which isn't fixed in the current build on try.gitea.io. Or is the current master not yet deployed?

Screenshot_20200228_231225

Should I open a new issue for this or recycle this one?

@zeripath
Copy link
Contributor

Open a new one

@alexanderadam
Copy link
Author

done. Thank you again for fixing those issues so fast.
And you are even answering blazingly fast. 😉

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants