From cdb0a541554aa4a16fc71b6425225e8c603c83b8 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Thu, 2 Oct 2025 12:03:06 +0200 Subject: feat(markdown): support external link and image (without source) --- mardown/ast_external_test.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 mardown/ast_external_test.go (limited to 'mardown/ast_external_test.go') diff --git a/mardown/ast_external_test.go b/mardown/ast_external_test.go new file mode 100644 index 0000000..fc0597d --- /dev/null +++ b/mardown/ast_external_test.go @@ -0,0 +1,31 @@ +package mardown + +import "testing" + +func TestExternal(t *testing.T) { + lxs := lex("[content](href)") + tree, err := ast(lxs) + if err != nil { + t.Fatal(err) + } + got, err := tree.Eval() + if err != nil { + t.Fatal(err) + } + if string(got) != `

content

` { + t.Errorf("invalid value, got %s", got) + } + + lxs = lex("![image alt](image src)") + tree, err = ast(lxs) + if err != nil { + t.Fatal(err) + } + got, err = tree.Eval() + if err != nil { + t.Fatal(err) + } + if string(got) != `
image alt
` { + t.Errorf("invalid value, got %s", got) + } +} -- cgit v1.2.3