README.md in npm package cause gitea to crash #10327

Closed
opened 2025-11-02 09:04:25 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @nmqh on GitHub (Feb 23, 2023).

Originally assigned to: @Zettat123 on GitHub.

Description

After the attached file README.md is included in a npm package and published to GITea, and then when package details page is opened in GITea site for this package, GITea crashes (see attached error message) AppErrorAndCrash

In the README.md if the following line is removed and published, the gitea app/service does not fail when viewing the package details in GITea.
- The pacakge name @qccat-ui has been renamed to @qccat/core-ui.

Gitea Version

1.18.5

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

GITea is running in windows.

Database

None

Originally created by @nmqh on GitHub (Feb 23, 2023). Originally assigned to: @Zettat123 on GitHub. ### Description After the attached file [README.md](https://github.com/go-gitea/gitea/files/10809506/README.md) is included in a npm package and published to GITea, and then when package details page is opened in GITea site for this package, GITea crashes (see attached error message) ![AppErrorAndCrash](https://user-images.githubusercontent.com/79547337/220799673-cf598b01-d3a3-4b62-b5fb-0e2747664288.jpg) In the README.md if the following line is removed and published, the gitea app/service does not fail when viewing the package details in GITea. `- The pacakge name @qccat-ui has been renamed to @qccat/core-ui.` ### Gitea Version 1.18.5 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? GITea is running in windows. ### Database None
GiteaMirror added the topic/packagestype/bug labels 2025-11-02 09:04:25 -06:00
Author
Owner

@Zettat123 commented on GitHub (Feb 23, 2023):

I think the reason of the panic is the ctx.Ctx is nil

6c35454654/modules/markup/html.go (L615)

ctx.Ctx should be set when create markup.RenderContext

6c35454654/modules/templates/helper.go (L177-L180)

@Zettat123 commented on GitHub (Feb 23, 2023): I think the reason of the panic is the `ctx.Ctx` is `nil` https://github.com/go-gitea/gitea/blob/6c354546547cd3a9595a7db119a6480d9cd506a7/modules/markup/html.go#L615 `ctx.Ctx` should be set when create `markup.RenderContext` https://github.com/go-gitea/gitea/blob/6c354546547cd3a9595a7db119a6480d9cd506a7/modules/templates/helper.go#L177-L180
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10327