Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

escape_test.gno

0.77 Kb · 18 lines
 1package piglatindemo
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/nt/uassert/v0"
 7)
 8
 9// payload closes a one-backtick code span and opens an image. Written raw, as
10// v0 does, it renders as markup the realm appears to have authored.
11const payload = "x` ![p](https:e.io) `y"
12
13// TestRenderEscapesSentence pins that the sentence and its translation are
14// escaped inside their blockquotes: v0 wrote both raw, so an image or a link
15// in the path rendered, and Translate keeps punctuation in place.
16func TestRenderEscapesSentence(t *testing.T) {
17	uassert.Equal(t, "# Pig Latin\n\n**Original:**\n\n> x\\` \\!\\[p\\]\\(https:e\\.io\\) \\`y\n\n**Pig Latin:**\n\n> xay\\` \\!\\[e\\.iop\\]\\(https:ay\\) \\`yay\n\n---\n\n[← rules & examples](/r/moul/x/daily/piglatindemo/v1)\n", Render("/"+payload))
18}