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 --- custom/extensions/about-render.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'custom/extensions/about-render.lua') diff --git a/custom/extensions/about-render.lua b/custom/extensions/about-render.lua index 1543795..3c92252 100644 --- a/custom/extensions/about-render.lua +++ b/custom/extensions/about-render.lua @@ -294,7 +294,8 @@ if has_lpeg then local whitespace = S(" \t\r\n\f\v") local eol = P(-1) - local marker = S("`![*_<") + local marker = S("`![*_<\\") + local punctuation = S("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~") local url_char = 1 - S(")") - whitespace -- Bound the link and image inner scans. Without a cap a readme of -- unclosed brackets ("[[[[...") makes every position scan to the @@ -347,6 +348,7 @@ if has_lpeg then -- a remote one would have every visitor's browser call a third party. local inline_grammar = Ct(( (P("`") * C((1 - P("`")) ^ 1) * P("`")) / node_code + + (P("\\") * C(punctuation)) / node_text + (P("<") * C(uri) * P(">")) / node_autolink + (P("<") * C(address) * P(">")) / node_mail + (P("[!") * label * target * P("]") * target) / node_image -- cgit