More encoding issues.

This commit is contained in:
Discsearcher
2026-09-02 00:59:51 -04:00
parent bce253d27d
commit ef9b01e60c
+3 -4
View File
@@ -12,7 +12,6 @@ from werkzeug.security import generate_password_hash, check_password_hash
import markdown
import logging
import re
from urllib.parse import quote
from email import message_from_string
from email.mime.text import MIMEText
from whoosh.index import create_in, open_dir
@@ -360,9 +359,9 @@ def rewrite_eml_file_links(md_content, filepath):
# Ensure forward slashes for URL
resolved_path = resolved_path.replace(os.sep, '/')
# URL-encode the path, preserving forward slashes
encoded_path = quote(resolved_path, safe='/')
file_url = f"/file/{encoded_path}"
# Do NOT URL-encode here - the browser will encode the href attribute automatically
# when creating the HTTP request (otherwise we get double encoding)
file_url = f"/file/{resolved_path}"
return f"[{link_text}]({file_url})"