Html comments are shown in PR and issue descriptions #8742

Closed
opened 2025-11-02 08:16:10 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @viceice on GitHub (Mar 24, 2022).

Description

Since v1.16.5 Html comments are shown in PR and issue descriptions, they should be hidden as before.

Reproducer: https://try.gitea.io/viceice/test/issues/1

Gitea Version

1.16.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

Official helm chart with slim image

Database

PostgreSQL

Originally created by @viceice on GitHub (Mar 24, 2022). ### Description Since v1.16.5 Html comments are shown in PR and issue descriptions, they should be hidden as before. Reproducer: https://try.gitea.io/viceice/test/issues/1 ### Gitea Version 1.16.5 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots ![image](https://user-images.githubusercontent.com/1798109/159889314-87fa78bd-368e-4743-83e6-ea13455642cd.png) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Official helm chart with slim image ### Database PostgreSQL
GiteaMirror added the type/bugtype/upstream labels 2025-11-02 08:16:10 -06:00
Author
Owner

@viceice commented on GitHub (Mar 24, 2022):

It seems < is encoded as \x3C 🤔

@viceice commented on GitHub (Mar 24, 2022): It seems `<` is encoded as `\x3C` 🤔
Author
Owner

@xoxys commented on GitHub (Mar 24, 2022):

As discussed in the chat:

gitea on  HEAD (e6d46ee) (BISECTING) [$] via 🐹 v1.16.15 via  v16.14.0 took 8s 
❯ git bisect good
f9ea4ab69ae397be4791c2e2ebf59f6cd9e5a6f8 is the first bad commit
commit f9ea4ab69ae397be4791c2e2ebf59f6cd9e5a6f8
Author: techknowlogick <techknowlogick@gitea.io>
Date:   Sat Mar 19 13:46:47 2022 -0400
@xoxys commented on GitHub (Mar 24, 2022): As discussed in the chat: ``` gitea on  HEAD (e6d46ee) (BISECTING) [$] via 🐹 v1.16.15 via  v16.14.0 took 8s ❯ git bisect good f9ea4ab69ae397be4791c2e2ebf59f6cd9e5a6f8 is the first bad commit commit f9ea4ab69ae397be4791c2e2ebf59f6cd9e5a6f8 Author: techknowlogick <techknowlogick@gitea.io> Date: Sat Mar 19 13:46:47 2022 -0400 ```
Author
Owner

@viceice commented on GitHub (Mar 24, 2022):

maybe the github.com/yuin/goldmark v1.4.0 to v1.4.8 update?

@viceice commented on GitHub (Mar 24, 2022): maybe the `github.com/yuin/goldmark` v1.4.0 to v1.4.8 update?
Author
Owner

@viceice commented on GitHub (Mar 24, 2022):

I think this is fixed in a later version

@viceice commented on GitHub (Mar 24, 2022): I think this is fixed in a later version - https://github.com/yuin/goldmark/issues/285 - https://github.com/yuin/goldmark/commit/e64a68fc130e0c74dd2cbec59e6737a2e2bb7398 - https://github.com/yuin/goldmark/releases/tag/v1.4.9
Author
Owner

@xoxys commented on GitHub (Mar 24, 2022):

Should be a quick fix in this case.

@xoxys commented on GitHub (Mar 24, 2022): Should be a quick fix in this case.
Author
Owner

@viceice commented on GitHub (Mar 24, 2022):

When can i expect a fixed gitea version? If it needs some days i would create a small jquery script on page load to fix it temporary

@viceice commented on GitHub (Mar 24, 2022): When can i expect a fixed gitea version? If it needs some days i would create a small jquery script on page load to fix it temporary
Author
Owner

@xoxys commented on GitHub (Mar 24, 2022):

Don't know, one of the maintainers could give us a rough timeline.

@xoxys commented on GitHub (Mar 24, 2022): Don't know, one of the maintainers could give us a rough timeline.
Author
Owner

@viceice commented on GitHub (Mar 24, 2022):

Just ask if it's worth to create the quickfix 🙃

@viceice commented on GitHub (Mar 24, 2022): Just ask if it's worth to create the quickfix 🙃
Author
Owner

@xoxys commented on GitHub (Mar 24, 2022):

Can confirm that updating goldmark fixes the issue:

❯ docker run -v $(pwd):/drone/src --workdir /drone/src -it golang:1.18 bash
root@c5219c2fabbe:/drone/src# go get -u github.com/yuin/goldmark
go: downloading github.com/yuin/goldmark v1.4.11
go: upgraded github.com/yuin/goldmark v1.4.8 => v1.4.11
root@c5219c2fabbe:/drone/src# TAGS="bindata sqlite sqlite_unlock_notify" make build

So you could build it with the fixed version from the release/v1.16 branch on your own.

@xoxys commented on GitHub (Mar 24, 2022): Can confirm that updating goldmark fixes the issue: ``` ❯ docker run -v $(pwd):/drone/src --workdir /drone/src -it golang:1.18 bash root@c5219c2fabbe:/drone/src# go get -u github.com/yuin/goldmark go: downloading github.com/yuin/goldmark v1.4.11 go: upgraded github.com/yuin/goldmark v1.4.8 => v1.4.11 root@c5219c2fabbe:/drone/src# TAGS="bindata sqlite sqlite_unlock_notify" make build ``` So you could build it with the fixed version from the `release/v1.16` branch on your own.
Author
Owner

@viceice commented on GitHub (Mar 24, 2022):

OK, thanks. Will do a jQuery quickfix for now. It's easier, as i already have a custom js file embedded. 😉

$('.task-list-item').contents().each((i, e) => {
  if (e.nodeName === '#text') {
    e.textContent = e.textContent.replaceAll(/\x3C!--.*?-->/g, '')
  }
})
@viceice commented on GitHub (Mar 24, 2022): OK, thanks. Will do a jQuery quickfix for now. It's easier, as i already have a custom js file embedded. 😉 ```js $('.task-list-item').contents().each((i, e) => { if (e.nodeName === '#text') { e.textContent = e.textContent.replaceAll(/\x3C!--.*?-->/g, '') } }) ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8742