loading up the forgejo repo on tangled to test page performance

chore(ui): remove ineffective class small in inline code preview (#7414)

Followup to https://codeberg.org/forgejo/forgejo/pulls/2669
Ref https://codeberg.org/forgejo/forgejo/issues/5067

Since Forgejo v9 this class is overridden here by other CSS and is ineffective. But it looks ok and gives good visibility. If it needs to be re-implemed, it can be done via CSS, like:
```css
.file-preview-box .header span {font-size:0.8rem;}
```

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7414
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: 0ko <0ko@noreply.codeberg.org>
Co-committed-by: 0ko <0ko@noreply.codeberg.org>

authored by 0ko 0ko and committed by Gusted da62c2ca 979cc5cd

Changed files
+16 -16
modules
+1 -1
modules/markup/file_preview.go
··· 341 341 psubtitle := &html.Node{ 342 342 Type: html.ElementNode, 343 343 Data: atom.Span.String(), 344 - Attr: []html.Attribute{{Key: "class", Val: "text small grey"}}, 344 + Attr: []html.Attribute{{Key: "class", Val: "text grey"}}, 345 345 } 346 346 psubtitle.AppendChild(&html.Node{ 347 347 Type: html.RawNode,
+14 -14
modules/markup/html_test.go
··· 721 721 `<div>`+ 722 722 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 723 723 `</div>`+ 724 - `<span class="text small grey">`+ 724 + `<span class="text grey">`+ 725 725 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 726 726 `</span>`+ 727 727 `</div>`+ ··· 755 755 `<a href="http://localhost:3000/gogits/gogs/" rel="nofollow">gogits/gogs</a> – `+ 756 756 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 757 757 `</div>`+ 758 - `<span class="text small grey">`+ 758 + `<span class="text grey">`+ 759 759 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">gogits/gogs@190d949</a>`+ 760 760 `</span>`+ 761 761 `</div>`+ ··· 791 791 `<a href="http://localhost:3000/gogits/gogs/" rel="nofollow">gogits/gogs</a> – `+ 792 792 `<a href="http://localhost:3000/gogits/gogs/src/commit/4c1aaf56bcb9f39dcf65f3f250726850aed13cd6/single-line.txt#L1" class="muted" rel="nofollow">single-line.txt</a>`+ 793 793 `</div>`+ 794 - `<span class="text small grey">`+ 794 + `<span class="text grey">`+ 795 795 `Line 1 in <a href="http://localhost:3000/gogits/gogs/src/commit/4c1aaf56bcb9f39dcf65f3f250726850aed13cd6" class="text black" rel="nofollow">gogits/gogs@4c1aaf5</a>`+ 796 796 `</span>`+ 797 797 `</div>`+ ··· 834 834 `<div>`+ 835 835 `<a href="http://localhost:3000/sub/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 836 836 `</div>`+ 837 - `<span class="text small grey">`+ 837 + `<span class="text grey">`+ 838 838 `Lines 2 to 3 in <a href="http://localhost:3000/sub/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 839 839 `</span>`+ 840 840 `</div>`+ ··· 865 865 `<div>`+ 866 866 `<a href="http://localhost:3000/sub/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 867 867 `</div>`+ 868 - `<span class="text small grey">`+ 868 + `<span class="text grey">`+ 869 869 `Lines 2 to 3 in <a href="http://localhost:3000/sub/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 870 870 `</span>`+ 871 871 `</div>`+ ··· 898 898 `<div>`+ 899 899 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 900 900 `</div>`+ 901 - `<span class="text small grey">`+ 901 + `<span class="text grey">`+ 902 902 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 903 903 `</span>`+ 904 904 `</div>`+ ··· 923 923 `<div>`+ 924 924 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 925 925 `</div>`+ 926 - `<span class="text small grey">`+ 926 + `<span class="text grey">`+ 927 927 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 928 928 `</span>`+ 929 929 `</div>`+ ··· 954 954 `<div>`+ 955 955 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 956 956 `</div>`+ 957 - `<span class="text small grey">`+ 957 + `<span class="text grey">`+ 958 958 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 959 959 `</span>`+ 960 960 `</div>`+ ··· 979 979 `<div>`+ 980 980 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 981 981 `</div>`+ 982 - `<span class="text small grey">`+ 982 + `<span class="text grey">`+ 983 983 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 984 984 `</span>`+ 985 985 `</div>`+ ··· 1004 1004 `<div>`+ 1005 1005 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 1006 1006 `</div>`+ 1007 - `<span class="text small grey">`+ 1007 + `<span class="text grey">`+ 1008 1008 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 1009 1009 `</span>`+ 1010 1010 `</div>`+ ··· 1039 1039 `<div>`+ 1040 1040 `<a href="http://localhost:3000/gogits/gogs/src/commit/c9913120ed2c1e27c1d7752ecdb7a504dc7cf6be/path/to/file.md?display=source#L1-L2" class="muted" rel="nofollow">path/to/file.md</a>`+ 1041 1041 `</div>`+ 1042 - `<span class="text small grey">`+ 1042 + `<span class="text grey">`+ 1043 1043 `Lines 1 to 2 in <a href="http://localhost:3000/gogits/gogs/src/commit/c9913120ed2c1e27c1d7752ecdb7a504dc7cf6be" class="text black" rel="nofollow">c991312</a>`+ 1044 1044 `</span>`+ 1045 1045 `</div>`+ ··· 1072 1072 `<div>`+ 1073 1073 `<a href="http://localhost:3000/gogits/gogs/src/commit/c9913120ed2c1e27c1d7752ecdb7a504dc7cf6be/path/to/file.md?display=source#L1-L2" class="muted" rel="nofollow">path/to/file.md</a>`+ 1074 1074 `</div>`+ 1075 - `<span class="text small grey">`+ 1075 + `<span class="text grey">`+ 1076 1076 `Lines 1 to 2 in <a href="http://localhost:3000/gogits/gogs/src/commit/c9913120ed2c1e27c1d7752ecdb7a504dc7cf6be" class="text black" rel="nofollow">c991312</a>`+ 1077 1077 `</span>`+ 1078 1078 `</div>`+ ··· 1107 1107 `<div>`+ 1108 1108 `<a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20/path/to/file.go?display=source#L2-L3" class="muted" rel="nofollow">path/to/file.go</a>`+ 1109 1109 `</div>`+ 1110 - `<span class="text small grey">`+ 1110 + `<span class="text grey">`+ 1111 1111 `Lines 2 to 3 in <a href="http://localhost:3000/gogits/gogs/src/commit/190d9492934af498c3f669d6a2431dc5459e5b20" class="text black" rel="nofollow">190d949</a>`+ 1112 1112 `</span>`+ 1113 1113 `</div>`+ ··· 1142 1142 `<div>`+ 1143 1143 `<a href="http://localhost:3000/gogits/gogs/src/commit/eeb243c3395e1921c5d90e73bd739827251fc99d/path/to/file%20%23.txt#L1" class="muted" rel="nofollow">path/to/file #.txt</a>`+ 1144 1144 `</div>`+ 1145 - `<span class="text small grey">`+ 1145 + `<span class="text grey">`+ 1146 1146 `Line 1 in <a href="http://localhost:3000/gogits/gogs/src/commit/eeb243c3395e1921c5d90e73bd739827251fc99d" class="text black" rel="nofollow">eeb243c</a>`+ 1147 1147 `</span>`+ 1148 1148 `</div>`+
+1 -1
modules/markup/sanitizer.go
··· 122 122 policy.AllowAttrs("class").Matching(regexp.MustCompile("^ui table$")).OnElements("div") 123 123 policy.AllowAttrs("class").Matching(regexp.MustCompile("^header$")).OnElements("div") 124 124 policy.AllowAttrs("data-line-number").Matching(regexp.MustCompile("^[0-9]+$")).OnElements("span") 125 - policy.AllowAttrs("class").Matching(regexp.MustCompile("^text small grey$")).OnElements("span") 125 + policy.AllowAttrs("class").Matching(regexp.MustCompile("^text grey$")).OnElements("span") 126 126 policy.AllowAttrs("class").Matching(regexp.MustCompile("^file-preview$")).OnElements("table") 127 127 policy.AllowAttrs("class").Matching(regexp.MustCompile("^lines-escape$")).OnElements("td") 128 128 policy.AllowAttrs("class").Matching(regexp.MustCompile("^toggle-escape-button btn interact-bg$")).OnElements("button")