From dd53b1bfa9c3e60f73a79b3ee1462dee896da693 Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Fri, 10 Oct 2025 17:46:28 +0200 Subject: g2h: Before regex: I have one problem After regex: I have $? problems --- src/g2h/file_page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g2h/file_page.py b/src/g2h/file_page.py index c317454..b094276 100644 --- a/src/g2h/file_page.py +++ b/src/g2h/file_page.py @@ -40,7 +40,7 @@ class FilePage(Page): if file_type == 'text': if self.file_name.lower().endswith('.md'): backtick_max = -1 - content = re.sub(r'(`{3,}\W)', r'\\\1', content) + content = re.sub(r'(`{3,}s*[^\w|\n])', r'\\\1', content) else: matches = re.findall('`+', content) backtick_max = max(max(len(match) for match in matches) if matches else 0, backtick_max) -- cgit v1.2.3