From 87dba241820b33111017b041f624a88e74e4220a Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Fri, 10 Oct 2025 17:38:00 +0200 Subject: g2h: Escape markdown code blocks that specify a non-word language This is mostly a workaround for the early version of the file.md which had ```{{ --- src/g2h/file_page.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/g2h') diff --git a/src/g2h/file_page.py b/src/g2h/file_page.py index f2e0550..c317454 100644 --- a/src/g2h/file_page.py +++ b/src/g2h/file_page.py @@ -40,6 +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) 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