Skip to content

Commit 6a6ea58

Browse files
wxiaoguangyardenshoham
authored andcommitted
Update modules/templates/helper.go
1 parent 2ba18c3 commit 6a6ea58

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/templates/helper.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ func RenderCommitBody(ctx context.Context, msg, urlPrefix string, metas map[stri
799799
// Match text that is between back ticks.
800800
var codeMatcher = regexp.MustCompile("`([^`]+)`")
801801

802+
// RenderCodeBlock renders "`…`" as highlighted "<code>" block.
803+
// Intended for issue and PR titles, these containers should have styles for "<code>" elements
802804
func RenderCodeBlock(htmlEscapedTextToRender template.HTML) template.HTML {
803805
htmlWithCodeTags := codeMatcher.ReplaceAllString(string(htmlEscapedTextToRender), "<code>$1</code>") // replace with HTML <code> tags
804806
return template.HTML(htmlWithCodeTags)

0 commit comments

Comments
 (0)