From 151ea12251ed876aa87bb486da1bc337e25369e9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 1 Aug 2026 16:18:19 -0300 Subject: --- vrsite/markdown_test.go | 244 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 244 insertions(+) create mode 100644 vrsite/markdown_test.go (limited to 'vrsite/markdown_test.go') diff --git a/vrsite/markdown_test.go b/vrsite/markdown_test.go new file mode 100644 index 0000000..e8f1fe1 --- /dev/null +++ b/vrsite/markdown_test.go @@ -0,0 +1,244 @@ +package main + +import ( + "net/http/httptest" + "net/url" + "strings" + "testing" +) + +func testMarkdown(t *testing.T) *markdown { + t.Helper() + return newMarkdown(newHighlighter(loadTheme("", "", "dark"), loadTheme("", "", "light"))) +} + +func TestMarkdownNotes(t *testing.T) { + m := testMarkdown(t) + cases := []struct { + name string + in string + want []string + not []string + }{ + { + name: "inline marks", + in: "`detect()` prefers **direct env** and only walks the tree as *fallback*", + want: []string{"detect()", "direct env", "fallback"}, + }, + { + name: "list after a paragraph", + in: "three classes:\n\n- persisted RPC narrowed\n- ingress bounds change", + want: []string{"

three classes:

", "