enhance(markup): improve issue title rendering (#37908)

This commit is contained in:
silverwind
2026-05-30 18:55:26 +02:00
committed by GitHub
parent 0359746abe
commit 82cf75b68a
5 changed files with 53 additions and 5 deletions
+5
View File
@@ -69,6 +69,11 @@ func emojiShortCodeProcessor(ctx *RenderContext, node *html.Node) {
m[1] += start
start = m[1]
// don't render a shortcode whose ":" directly follows a backtick (an unclosed code span)
if m[0] > 0 && node.Data[m[0]-1] == '`' {
continue
}
alias := node.Data[m[0]:m[1]]
var nextChar byte
+3
View File
@@ -377,6 +377,9 @@ func TestRender_emoji(t *testing.T) {
test(":100:200", `<p>:100:200</p>`)
test("std::thread::something", `<p>std::thread::something</p>`)
test(":not exist:", `<p>:not exist:</p>`)
test("foo `:smile:", "<p>foo `:smile:</p>")
test("foo `:smile:`", `<p>foo <code>:smile:</code></p>`)
test("foo ` :smile:", "<p>foo ` <span class=\"emoji\" aria-label=\"grinning face with smiling eyes\">😄</span></p>")
}
func TestRender_ShortLinks(t *testing.T) {