diff options
Diffstat (limited to 'src/g2h/file_page.py')
| -rw-r--r-- | src/g2h/file_page.py | 7 |
1 files changed, 5 insertions, 2 deletions
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, |