aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup/html.go
diff options
context:
space:
mode:
authorEarl Warren <109468362+earl-warren@users.noreply.github.com>2023-08-07 15:11:25 +0200
committerGitHub <noreply@github.com>2023-08-07 15:11:25 +0200
commit87f70979cfe2ba8662b12b688f020b7732741de0 (patch)
tree39f334980866ef558f675c9311667bdcf806f11f /modules/markup/html.go
parente4b1ea6f15790b3ce918a29404f93353d7143a1c (diff)
downloadgitea-87f70979cfe2ba8662b12b688f020b7732741de0.tar.gz
gitea-87f70979cfe2ba8662b12b688f020b7732741de0.zip
Do not highlight `#number` in documents (#26365)
- Currently the post processing will transform all issue indexes (such as `#6`) into a clickable link. - This makes sense in an situation like issues or PRs, where referencing to other issues is quite common and only referencing their issue index is an handy and efficient way to do it. - Currently this is also run for documents (which is the user profile and viewing rendered files), but in those situations it's less common to reference issues by their index and instead could mean something else. - This patch disables this post processing for issue index for documents. Matches Github's behavior. - Added unit tests. - Resolves https://codeberg.org/Codeberg/Community/issues/1120 Co-authored-by: Gusted <postmaster@gusted.xyz>
Diffstat (limited to 'modules/markup/html.go')
-rw-r--r--modules/markup/html.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/markup/html.go b/modules/markup/html.go
index da16bcd3cb..e53ccc6a79 100644
--- a/modules/markup/html.go
+++ b/modules/markup/html.go
@@ -852,7 +852,7 @@ func fullIssuePatternProcessor(ctx *RenderContext, node *html.Node) {
}
func issueIndexPatternProcessor(ctx *RenderContext, node *html.Node) {
- if ctx.Metas == nil {
+ if ctx.Metas == nil || ctx.Metas["mode"] == "document" {
return
}
var (