codespan_test.gno
0.48 Kb · 16 lines
1package ratelimitdemo
2
3import (
4 "strings"
5 "testing"
6)
7
8// A crafted /addr/<key> path used to close this code span early and render its
9// own markdown. md.InlineCode sizes the fence past any backtick run, so the
10// payload comes back inside a double fence with the backtick intact.
11func TestRenderPathCannotEscapeItsCodeSpan(t *testing.T) {
12 out := Render("/addr/a`b")
13 if !strings.Contains(out, "``a`b``") {
14 t.Fatalf("the fence did not outscan the caller's backtick: %q", out)
15 }
16}