From a9a1aa36a2a5b11b891fb861e16ba4e4d5a1e3ee Mon Sep 17 00:00:00 2001 From: Mex <44814932+MMexicann@users.noreply.github.com> Date: Sun, 15 Nov 2026 20:26:14 +0100 Subject: [PATCH] M14: preserve existing PDF suffixes in web exports Recognize an existing PDF extension without changing its case or the requested filename. --- crates/ui-egui/src/app/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/app/commands.rs b/crates/ui-egui/src/app/commands.rs index 86bed7fe6d..75d6ca817e 100644 --- a/crates/ui-egui/src/app/commands.rs +++ b/crates/ui-egui/src/app/commands.rs @@ -145,7 +145,7 @@ impl WordApp { // Web: saving and exporting become downloads. if self.services.download.is_some() && matches!(id, "file.save" | "file.saveAs" | "file.exportPdf" | "file.exportPng") { let name = params.get("path").and_then(Value::as_str).map(str::to_string).unwrap_or_else(|| self.web_save_name(id)); - let name = if id == "file.exportPdf" && !name.ends_with(".pdf") { format!("{name}.pdf") } else { name }; + let name = if id == "file.exportPdf" && !name.to_ascii_lowercase().ends_with(".pdf") { format!("{name}.pdf") } else { name }; // A save with a password encrypts this and later saves (`file.save`'s `password`). if matches!(id, "file.save" | "file.saveAs") && let Some(pw) = params.get("password").filter(|v| !v.is_null())