FossilRepo

Fix content detection: default to markdown instead of raw passthrough

lmata 2026-04-06 15:31 trunk
Commit 7e8593275d211081dcadff7c18d39b2248240d6d227f835b697d80f3bc869008
1 file changed +2 -1
+2 -1
--- fossil/views.py
+++ fossil/views.py
@@ -87,11 +87,12 @@
8787
if "```" in stripped:
8888
return True
8989
# Starts with HTML block element — it's Fossil wiki/HTML
9090
if re.match(r"<(h[1-6]|p|ol|ul|div|table)\b", stripped, re.IGNORECASE):
9191
return False
92
- return False
92
+ # Default: treat as markdown (handles plain text gracefully)
93
+ return True
9394
9495
9596
def _rewrite_fossil_links(html: str, project_slug: str) -> str:
9697
"""Rewrite internal Fossil URLs to our app's URL structure.
9798
9899
--- fossil/views.py
+++ fossil/views.py
@@ -87,11 +87,12 @@
87 if "```" in stripped:
88 return True
89 # Starts with HTML block element — it's Fossil wiki/HTML
90 if re.match(r"<(h[1-6]|p|ol|ul|div|table)\b", stripped, re.IGNORECASE):
91 return False
92 return False
 
93
94
95 def _rewrite_fossil_links(html: str, project_slug: str) -> str:
96 """Rewrite internal Fossil URLs to our app's URL structure.
97
98
--- fossil/views.py
+++ fossil/views.py
@@ -87,11 +87,12 @@
87 if "```" in stripped:
88 return True
89 # Starts with HTML block element — it's Fossil wiki/HTML
90 if re.match(r"<(h[1-6]|p|ol|ul|div|table)\b", stripped, re.IGNORECASE):
91 return False
92 # Default: treat as markdown (handles plain text gracefully)
93 return True
94
95
96 def _rewrite_fossil_links(html: str, project_slug: str) -> str:
97 """Rewrite internal Fossil URLs to our app's URL structure.
98
99

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button