Skip to content

Commit be8ffbd

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: Add tooltip to repo icons in explore page (go-gitea#20241) Fix NPE when using non-numeric (go-gitea#20277)
2 parents 310604f + c273dea commit be8ffbd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

modules/markup/html.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,10 @@ func issueIndexPatternProcessor(ctx *RenderContext, node *html.Node) {
841841

842842
// Repos with external issue trackers might still need to reference local PRs
843843
// We need to concern with the first one that shows up in the text, whichever it is
844-
if hasExtTrackFormat && !isNumericStyle {
844+
if hasExtTrackFormat && !isNumericStyle && refNumeric != nil {
845845
// If numeric (PR) was found, and it was BEFORE the non-numeric pattern, use that
846-
if foundNumeric && refNumeric.RefLocation.Start < ref.RefLocation.Start {
846+
// Allow a free-pass when non-numeric pattern wasn't found.
847+
if found && (ref == nil || refNumeric.RefLocation.Start < ref.RefLocation.Start) {
847848
found = foundNumeric
848849
ref = refNumeric
849850
}

templates/explore/repo_list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@
3232
{{end}}
3333
{{end}}
3434
{{if .IsFork}}
35-
{{svg "octicon-repo-forked"}}
35+
<span class="tooltip" data-content="{{$.locale.Tr "repo.fork"}}" data-position="bottom center">{{svg "octicon-repo-forked"}}</span>
3636
{{else if .IsMirror}}
37-
{{svg "octicon-mirror"}}
37+
<span class="tooltip" data-content="{{$.locale.Tr "mirror"}}" data-position="bottom center">{{svg "octicon-mirror"}}</span>
3838
{{end}}
3939
</div>
4040
</div>

0 commit comments

Comments
 (0)