From 85da4abc206f2cc8819836bb0e8727de3a51d24c Mon Sep 17 00:00:00 2001 From: Christoph Schlosser Date: Fri, 10 Oct 2025 17:19:27 +0200 Subject: g2h: Render markdown files instead of putting them into code blocks --- src/g2h/file_page.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/g2h/file_page.py') diff --git a/src/g2h/file_page.py b/src/g2h/file_page.py index d64cb84..f2e0550 100644 --- a/src/g2h/file_page.py +++ b/src/g2h/file_page.py @@ -38,8 +38,11 @@ class FilePage(Page): content, file_type = bytes_to_content(file_bytes) backtick_max = 2 if file_type == 'text': - matches = re.findall('`+', content) - backtick_max = max(max(len(match) for match in matches) if matches else 0, backtick_max) + if self.file_name.lower().endswith('.md'): + backtick_max = -1 + else: + matches = re.findall('`+', content) + backtick_max = max(max(len(match) for match in matches) if matches else 0, backtick_max) return { 'backtick_max': backtick_max + 1, -- cgit v1.2.3