FossilRepo
Fix content detection: default to markdown instead of raw passthrough
Commit
7e8593275d211081dcadff7c18d39b2248240d6d227f835b697d80f3bc869008
Parent
11cb22eea564355…
1 file changed
+2
-1
+2
-1
| --- fossil/views.py | ||
| +++ fossil/views.py | ||
| @@ -87,11 +87,12 @@ | ||
| 87 | 87 | if "```" in stripped: |
| 88 | 88 | return True |
| 89 | 89 | # Starts with HTML block element — it's Fossil wiki/HTML |
| 90 | 90 | if re.match(r"<(h[1-6]|p|ol|ul|div|table)\b", stripped, re.IGNORECASE): |
| 91 | 91 | return False |
| 92 | - return False | |
| 92 | + # Default: treat as markdown (handles plain text gracefully) | |
| 93 | + return True | |
| 93 | 94 | |
| 94 | 95 | |
| 95 | 96 | def _rewrite_fossil_links(html: str, project_slug: str) -> str: |
| 96 | 97 | """Rewrite internal Fossil URLs to our app's URL structure. |
| 97 | 98 | |
| 98 | 99 |
| --- 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 |