loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request '[BUG] Center icon and callout text' (#3010) from gusted/forgejo-center-icon into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3010
Reviewed-by: Gergely Nagy <algernon@noreply.codeberg.org>

+16 -2
+1
modules/markup/markdown/callout/github.go
··· 72 72 73 73 // create an emphasis to make it bold 74 74 attentionParagraph := ast.NewParagraph() 75 + attentionParagraph.SetAttributeString("class", []byte("attention-title")) 75 76 emphasis := ast.NewEmphasis(2) 76 77 emphasis.SetAttributeString("class", []byte("attention-"+attentionType)) 77 78 firstParagraph.InsertBefore(firstParagraph, firstTextNode, emphasis)
+9 -2
modules/markup/markdown/callout/github_legacy.go
··· 51 51 // color the blockquote 52 52 v.SetAttributeString("class", []byte("attention-header attention-"+calloutType)) 53 53 54 - // Prepend callout icon before the callout node itself 55 - firstParagraph.InsertBefore(firstParagraph, calloutNode, NewAttention(calloutType)) 54 + // Create new parargaph. 55 + attentionParagraph := ast.NewParagraph() 56 + attentionParagraph.SetAttributeString("class", []byte("attention-title")) 57 + 58 + // Move the callout node to the paragraph and insert the paragraph. 59 + attentionParagraph.AppendChild(attentionParagraph, NewAttention(calloutType)) 60 + attentionParagraph.AppendChild(attentionParagraph, calloutNode) 61 + firstParagraph.Parent().InsertBefore(firstParagraph.Parent(), firstParagraph, attentionParagraph) 62 + firstParagraph.RemoveChild(firstParagraph, calloutNode) 56 63 } 57 64 58 65 return ast.WalkContinue, nil
+1
modules/markup/sanitizer.go
··· 64 64 policy.AllowAttrs("class").Matching(regexp.MustCompile(`^color-preview$`)).OnElements("span") 65 65 66 66 // For attention 67 + policy.AllowAttrs("class").Matching(regexp.MustCompile(`^attention-title$`)).OnElements("p") 67 68 policy.AllowAttrs("class").Matching(regexp.MustCompile(`^attention-header attention-\w+$`)).OnElements("blockquote") 68 69 policy.AllowAttrs("class").Matching(regexp.MustCompile(`^attention-\w+$`)).OnElements("strong") 69 70 policy.AllowAttrs("class").Matching(regexp.MustCompile(`^attention-icon attention-\w+ svg octicon-[\w-]+$`)).OnElements("svg")
+5
web_src/css/base.css
··· 1127 1127 margin: auto 0.5em auto 0; 1128 1128 } 1129 1129 1130 + .attention-title { 1131 + align-items: center; 1132 + display: flex; 1133 + } 1134 + 1130 1135 blockquote.attention-note { 1131 1136 border-left-color: var(--color-blue-dark-1); 1132 1137 }