Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

codespan_test.gno

0.46 Kb · 16 lines
 1package grc20wrapdemo
 2
 3import (
 4	"strings"
 5	"testing"
 6)
 7
 8// A crafted URL path used to close this code span early and render its own
 9// markdown. md.InlineCode sizes the fence past any backtick run, so the payload
10// comes back inside a double fence with the backtick intact.
11func TestRenderPathCannotEscapeItsCodeSpan(t *testing.T) {
12	out := Render("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}