Skip to content

Commit 21ca3ad

Browse files
committed
Change Colors of links in header of filepreview
1 parent f1257c8 commit 21ca3ad

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

modules/markup/html.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,10 @@ func filePreviewPatternProcessor(ctx *RenderContext, node *html.Node) {
12711271
afilepath := &html.Node{
12721272
Type: html.ElementNode,
12731273
Data: atom.A.String(),
1274-
Attr: []html.Attribute{{Key: "href", Val: urlFull}},
1274+
Attr: []html.Attribute{
1275+
{Key: "href", Val: urlFull},
1276+
{Key: "class", Val: "muted"},
1277+
},
12751278
}
12761279
afilepath.AppendChild(&html.Node{
12771280
Type: html.TextNode,
@@ -1288,7 +1291,7 @@ func filePreviewPatternProcessor(ctx *RenderContext, node *html.Node) {
12881291
Type: html.TextNode,
12891292
Data: subTitle + " in ",
12901293
})
1291-
psubtitle.AppendChild(createLink(urlFull[m[0]:m[5]], commitSha[0:7], ""))
1294+
psubtitle.AppendChild(createLink(urlFull[m[0]:m[5]], commitSha[0:7], "text black"))
12921295
header.AppendChild(psubtitle)
12931296

12941297
preview := &html.Node{

modules/markup/sanitizer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ func createDefaultPolicy() *bluemonday.Policy {
134134
policy.AllowAttrs("class").Matching(regexp.MustCompile("^toggle-escape-button btn interact-bg$")).OnElements("a")
135135
policy.AllowAttrs("class").Matching(regexp.MustCompile("^ambiguous-code-point$")).OnElements("span")
136136
policy.AllowAttrs("data-tooltip-content").OnElements("span")
137+
policy.AllowAttrs("class").Matching(regexp.MustCompile("muted|(text black)")).OnElements("a")
137138

138139
// Allow generally safe attributes
139140
generalSafeAttrs := []string{

0 commit comments

Comments
 (0)