summaryrefslogtreecommitdiffstats
path: root/src/g2h/file_page.py
diff options
context:
space:
mode:
authorChristoph Schlosser <christoph@linux.com>2025-10-10 17:46:28 +0200
committerChristoph Schlosser <christoph@linux.com>2025-10-10 17:46:28 +0200
commitdd53b1bfa9c3e60f73a79b3ee1462dee896da693 (patch)
treec497231a6c496376633cffb34ead8721fac6601f /src/g2h/file_page.py
parent87dba241820b33111017b041f624a88e74e4220a (diff)
downloadgit2hugo-main.tar.gz
g2h: Before regex: I have one problemHEADmain
After regex: I have $? problems
Diffstat (limited to 'src/g2h/file_page.py')
-rw-r--r--src/g2h/file_page.py2
1 files changed, 1 insertions, 1 deletions
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)