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
Use relative links for commits, mentions, and issues in markdown #29427
Conversation
No, except you can know all the renderers will not be used on mail templates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The markdown renderer is only run for the UI and not for the API, right?
But yeah, I completely misunderstood the original request, I thought it talked about these headers (Reviewed-on
, …) in commit messages.
@lunny is right, mails would be broken. Fixed that and added a small test to prevent it in future. |
Don't know why the unit tests don't run in the workflow but running them locally revealed some errors in the tests. Reason is this: gitea/modules/markup/markdown/markdown_test.go Lines 24 to 26 in e55926e
That's not how our setting.AppURL and setting.AppSubURL work. Will fix this later.
|
I encountered a similar problem in #29222, the test data are inconsistent. |
Added #29459 to fix the tests. |
The tests use an invalid `setting.AppSubURL`. The wrong behaviour disturbs other PRs like go-gitea#29222 and go-gitea#29427.
Still WIP? |
- Port of go-gitea/gitea#29459 - The tests use an invalid `setting.AppSubURL`. The wrong behaviour disturbs other PRs like go-gitea/gitea#29222 and go-gitea/gitea#29427.
…R/gitea into enhancement-relative-link
@@ -222,7 +222,8 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient | |||
body, err := markdown.RenderString(&markup.RenderContext{ | |||
Ctx: ctx, | |||
Links: markup.Links{ | |||
Base: ctx.Issue.Repo.HTMLURL(), | |||
AbsolutePrefix: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mail, maybe /routers/common/markup.go
and/or rendered webhook messages should be the only places with AbsolutePrefix = true
. Some tests have true
too but that should be changed in another PR.
* main: fix missed RenderLabel change in card template (go-gitea#29772) Fix incorrect locale Tr for gpg command (go-gitea#29754) Improve a11y document and dropdown item (go-gitea#29753) Improve QueryEscape helper function (go-gitea#29768) Use relative links for commits, mentions, and issues in markdown (go-gitea#29427) Move fork router functions to a standalone file (go-gitea#29756) Configure pinned JS dependencies via updates.config.js (go-gitea#29696) Refactor to use optional.Option for issue index search option (go-gitea#29739) Fix user router possbile panic (go-gitea#29751) Refactor label.IsArchived() (go-gitea#29750) Fix date rendering by adding `<gitea-absolute-date>` (go-gitea#29725) Update to labeler v5 (go-gitea#29721) Update Chroma to v2.13.0 (go-gitea#29732)
* giteaofficial/main: Fix `make generate-swagger` in go 1.22 (go-gitea#29780) Fix incorrect menu/link on webhook edit page (go-gitea#29709) Add test for webhook (go-gitea#29755) Fix possible NPE in ToPullReviewList (go-gitea#29759) fix missed RenderLabel change in card template (go-gitea#29772) Fix incorrect locale Tr for gpg command (go-gitea#29754) Improve a11y document and dropdown item (go-gitea#29753) Improve QueryEscape helper function (go-gitea#29768) Use relative links for commits, mentions, and issues in markdown (go-gitea#29427) Move fork router functions to a standalone file (go-gitea#29756) Configure pinned JS dependencies via updates.config.js (go-gitea#29696) Refactor to use optional.Option for issue index search option (go-gitea#29739) Fix user router possbile panic (go-gitea#29751) Refactor label.IsArchived() (go-gitea#29750)
Fixes #29404
Use relative links for