File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,9 @@ package markup
55
66import (
77 "bytes"
8- "fmt"
9- "html/template"
108 "io"
119 "regexp"
10+ "slices"
1211 "strings"
1312 "sync"
1413
@@ -227,15 +226,16 @@ func RenderCommitMessageSubject(
227226 ctx * RenderContext ,
228227 defaultLink , content string ,
229228) (string , error ) {
230- procs := commitMessageSubjectProcessors
231- rendered , err := renderProcessString (ctx , procs , content )
232- if err != nil {
233- return "" , err
234- }
235- if defaultLink != "" {
236- rendered = fmt .Sprintf (`<a href="%s" class="muted">%s</a>` , template .HTMLEscapeString (defaultLink ), rendered )
237- }
238- return rendered , nil
229+ procs := slices .Clone (commitMessageSubjectProcessors )
230+ procs = append (procs , func (ctx * RenderContext , node * html.Node ) {
231+ ch := & html.Node {Parent : node , Type : html .TextNode , Data : node .Data }
232+ node .Type = html .ElementNode
233+ node .Data = "a"
234+ node .DataAtom = atom .A
235+ node .Attr = []html.Attribute {{Key : "href" , Val : defaultLink }, {Key : "class" , Val : "muted" }}
236+ node .FirstChild , node .LastChild = ch , ch
237+ })
238+ return renderProcessString (ctx , procs , content )
239239}
240240
241241// RenderIssueTitle to process title on individual issue/pull page
You can’t perform that action at this time.
0 commit comments