HTML sanitizer doesn't allow centering of text #4940

Closed
opened 2025-11-02 06:08:22 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @alexanderadam on GitHub (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

Originally created by @alexanderadam on GitHub (Feb 26, 2020). - Gitea version (or commit ref): ` 1.12.0+dev-379-ge5944a952` - Git version: irrelevant - Operating system: irrelevant - Database: irrelevant - Can you reproduce the bug at https://try.gitea.io: - Yes: https://try.gitea.io/alexanderadam/636f7374-cherry.cr - Log gist: irrelevant ## Description ~~See the missing icon in the README of [this mirror on try.gitea.io](https://try.gitea.io/alexanderadam/636f7374-cherry.cr/src/branch/master/readme.md) whereas the rendering [on GitHub is flawless](https://github.com/636f7374/cherry.cr/blob/master/readme.md).~~ (see #8830 for the image issue). The text centering of the headline is lost. ## Screenshots ![Screenshot_20200226_083247](https://user-images.githubusercontent.com/372620/75322217-9d7dba00-5872-11ea-950f-934180437928.png)
GiteaMirror added the type/enhancement label 2025-11-02 06:08:22 -06:00
Author
Owner

@jolheiser commented on GitHub (Feb 26, 2020):

The first issue is a duplicate of #8830

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

@jolheiser commented on GitHub (Feb 26, 2020): The first issue is a duplicate of #8830 The second is because of our sanitizer not allowing `align = "center"`.
Author
Owner

@zeripath commented on GitHub (Feb 26, 2020):

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.

@zeripath commented on GitHub (Feb 26, 2020): 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.
Author
Owner

@alexanderadam commented on GitHub (Feb 27, 2020):

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 commented on GitHub (Feb 27, 2020): > 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 :+1: > 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. :wink: 2. So the logic between Markdown and HTML rendering is diverged (= buggy)
Author
Owner

@zeripath commented on GitHub (Feb 27, 2020):

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

@zeripath commented on GitHub (Feb 27, 2020): see #10515 for dealing with the embedded html img tags ...
Author
Owner

@alexanderadam commented on GitHub (Feb 28, 2020):

Awesome, thank you Andrew!

@alexanderadam commented on GitHub (Feb 28, 2020): Awesome, thank you Andrew!
Author
Owner

@alexanderadam commented on GitHub (Feb 28, 2020):

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?

@alexanderadam commented on GitHub (Feb 28, 2020): 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`](https://try.gitea.io/alexanderadam/636f7374-cherry.cr#user-content-contributors). Or is the current master not yet deployed? ![Screenshot_20200228_231225](https://user-images.githubusercontent.com/372620/75591431-fd957b80-5a7f-11ea-91e3-c130cfb2b2f4.png) Should I open a new issue for this or recycle this one?
Author
Owner

@zeripath commented on GitHub (Feb 28, 2020):

Open a new one

@zeripath commented on GitHub (Feb 28, 2020): Open a new one
Author
Owner

@alexanderadam commented on GitHub (Feb 28, 2020):

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

@alexanderadam commented on GitHub (Feb 28, 2020): [done](https://github.com/go-gitea/gitea/issues/10542). Thank you again for fixing those issues so fast. And you are even _answering_ blazingly fast. :wink:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#4940