From bce253d27d7750b04e850714aeb32c6f19c000de39a59501c9c181418207a9f1 Mon Sep 17 00:00:00 2001 From: Discsearcher Date: Wed, 2 Sep 2026 00:55:47 -0400 Subject: [PATCH] Fixed regex pattern matching. --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index bcb5c46..d6aaa9d 100644 --- a/app.py +++ b/app.py @@ -367,7 +367,8 @@ def rewrite_eml_file_links(md_content, filepath): return f"[{link_text}]({file_url})" # Replace all markdown link references to .eml files - md_content = re.sub(r'\[([^\]]+)\]\(([^\)]+\.eml)\)', replace_link_path, md_content) + # Use non-greedy matching (.+?) to properly handle special characters like parentheses in filenames + md_content = re.sub(r'\[([^\]]+)\]\((.+?\.eml)\)', replace_link_path, md_content) return md_content def build_directory_tree():