Fixes, I hope.

This commit is contained in:
Discsearcher
2026-09-02 00:47:58 -04:00
parent 5359b57196
commit 6aaf4acbd1
+4 -1
View File
@@ -12,6 +12,7 @@ from werkzeug.security import generate_password_hash, check_password_hash
import markdown import markdown
import logging import logging
import re import re
from urllib.parse import quote
from email import message_from_string from email import message_from_string
from email.mime.text import MIMEText from email.mime.text import MIMEText
from whoosh.index import create_in, open_dir from whoosh.index import create_in, open_dir
@@ -359,7 +360,9 @@ def rewrite_eml_file_links(md_content, filepath):
# Ensure forward slashes for URL # Ensure forward slashes for URL
resolved_path = resolved_path.replace(os.sep, '/') resolved_path = resolved_path.replace(os.sep, '/')
file_url = f"/file/{resolved_path}" # URL-encode the path, preserving forward slashes
encoded_path = quote(resolved_path, safe='/')
file_url = f"/file/{encoded_path}"
return f"[{link_text}]({file_url})" return f"[{link_text}]({file_url})"