mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 09:27:17 +00:00
Remove rel
and id
attributes that only add the linenumber to elements
This commit is contained in:
parent
8218e80bfc
commit
10bca456a9
|
@ -149,7 +149,6 @@ func (p *FilePreview) CreateHTML(locale translation.Locale) *html.Node {
|
||||||
Type: html.ElementNode,
|
Type: html.ElementNode,
|
||||||
Data: atom.Td.String(),
|
Data: atom.Td.String(),
|
||||||
Attr: []html.Attribute{
|
Attr: []html.Attribute{
|
||||||
{Key: "id", Val: "L" + lineNum},
|
|
||||||
{Key: "class", Val: "lines-num"},
|
{Key: "class", Val: "lines-num"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -157,7 +156,6 @@ func (p *FilePreview) CreateHTML(locale translation.Locale) *html.Node {
|
||||||
Type: html.ElementNode,
|
Type: html.ElementNode,
|
||||||
Data: atom.Span.String(),
|
Data: atom.Span.String(),
|
||||||
Attr: []html.Attribute{
|
Attr: []html.Attribute{
|
||||||
{Key: "id", Val: "L" + lineNum},
|
|
||||||
{Key: "data-line-number", Val: lineNum},
|
{Key: "data-line-number", Val: lineNum},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -200,7 +198,6 @@ func (p *FilePreview) CreateHTML(locale translation.Locale) *html.Node {
|
||||||
Type: html.ElementNode,
|
Type: html.ElementNode,
|
||||||
Data: atom.Td.String(),
|
Data: atom.Td.String(),
|
||||||
Attr: []html.Attribute{
|
Attr: []html.Attribute{
|
||||||
{Key: "rel", Val: "L" + lineNum},
|
|
||||||
{Key: "class", Val: "lines-code chroma"},
|
{Key: "class", Val: "lines-code chroma"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,6 @@ func createDefaultPolicy() *bluemonday.Policy {
|
||||||
policy.AllowAttrs("class").Matching(regexp.MustCompile("^header$")).OnElements("div")
|
policy.AllowAttrs("class").Matching(regexp.MustCompile("^header$")).OnElements("div")
|
||||||
policy.AllowAttrs("data-line-number").Matching(regexp.MustCompile("^[0-9]+$")).OnElements("span")
|
policy.AllowAttrs("data-line-number").Matching(regexp.MustCompile("^[0-9]+$")).OnElements("span")
|
||||||
policy.AllowAttrs("class").Matching(regexp.MustCompile("^text small grey$")).OnElements("span")
|
policy.AllowAttrs("class").Matching(regexp.MustCompile("^text small grey$")).OnElements("span")
|
||||||
policy.AllowAttrs("rel").Matching(regexp.MustCompile("^L[0-9]+$")).OnElements("td")
|
|
||||||
policy.AllowAttrs("class").Matching(regexp.MustCompile("^file-preview*")).OnElements("table")
|
policy.AllowAttrs("class").Matching(regexp.MustCompile("^file-preview*")).OnElements("table")
|
||||||
policy.AllowAttrs("class").Matching(regexp.MustCompile("^lines-escape$")).OnElements("td")
|
policy.AllowAttrs("class").Matching(regexp.MustCompile("^lines-escape$")).OnElements("td")
|
||||||
policy.AllowAttrs("class").Matching(regexp.MustCompile("^toggle-escape-button btn interact-bg$")).OnElements("button")
|
policy.AllowAttrs("class").Matching(regexp.MustCompile("^toggle-escape-button btn interact-bg$")).OnElements("button")
|
||||||
|
|
Loading…
Reference in a new issue