From 02d16bcf1e733813899209eb970c78d15b44d02a Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 18:02:28 -1000 Subject: Honour backslash escapes in readmes --- tests/extensions/test-about-render.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index 601d0dc..236c61a 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -108,6 +108,15 @@ out = render("README.md", "an __up__ and _down_ word") h.contains("double underscores embolden", out, "up") h.contains("single underscores lean", out, "down") +out = render("README.md", "\\*not leaning\\* and \\# and \\q") +h.contains("a backslash makes punctuation literal", out, "

*not leaning* and # and \\q

") + +out = render("README.md", "\\# not a heading") +h.contains("an escaped hash starts no heading", out, "

# not a heading

") + +out = render("README.md", "`a\\*b`") +h.contains("code keeps its backslashes", out, "a\\*b") + out = render("README.md", "run `x < y` here") h.contains("inline code is escaped", out, "x < y") -- cgit