SHA256
More encoding issues.
This commit is contained in:
@@ -12,7 +12,6 @@ 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
|
||||||
@@ -360,9 +359,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, '/')
|
||||||
# URL-encode the path, preserving forward slashes
|
# Do NOT URL-encode here - the browser will encode the href attribute automatically
|
||||||
encoded_path = quote(resolved_path, safe='/')
|
# when creating the HTTP request (otherwise we get double encoding)
|
||||||
file_url = f"/file/{encoded_path}"
|
file_url = f"/file/{resolved_path}"
|
||||||
|
|
||||||
return f"[{link_text}]({file_url})"
|
return f"[{link_text}]({file_url})"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user