From 22897cfc1e6ac88a473a5ed19894d1d0b69d389d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 1 Oct 2026 23:18:06 -1000 Subject: Honour backslash escapes in readmes --- tests/extensions/test-about-render.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/extensions/test-about-render.lua') 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 2.12.1