From b211594ce8c7560a7d10eabb749a531325890763 Mon Sep 17 00:00:00 2001 From: James <63717587+jamesrayammons@users.noreply.github.com> Date: Tue, 14 Apr 2026 04:36:26 -0600 Subject: [PATCH] :bug: Fix hyphens stripped from export filenames (#8944) Replace str/slug with a targeted regex that only removes filesystem-unsafe characters when generating export filenames. The slug function strips all non-word characters including hyphens, causing names like "my-board" to become "myboard" on export. Fixes #8901 Signed-off-by: jamesrayammons Co-authored-by: Andrey Antukh --- CHANGES.md | 1 + exporter/src/app/handlers/resources.cljs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index aece6a2a85..21d977a0db 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -51,6 +51,7 @@ - Fix selected color tokens [Taiga #13930](https://tree.taiga.io/project/penpot/issue/13930) - Fix dashboard Recent/Deleted titles overlapped by scrolling content (by @rockchris99) [Github #8577](https://github.com/penpot/penpot/issues/8577) - Display resolved values of inactive tokens [Taiga #13628](https://tree.taiga.io/project/penpot/issue/13628) +- Fix hyphens stripped from export filenames (by @jamesrayammons) [Github #8901](https://github.com/penpot/penpot/issues/8901) - Fix app crash when selecting shapes with one hidden [Taiga #13959](https://tree.taiga.io/project/penpot/issue/13959) - Fix opacity mixed value [Taiga #13960](https://tree.taiga.io/project/penpot/issue/13960) diff --git a/exporter/src/app/handlers/resources.cljs b/exporter/src/app/handlers/resources.cljs index f0f655c498..e981856da4 100644 --- a/exporter/src/app/handlers/resources.cljs +++ b/exporter/src/app/handlers/resources.cljs @@ -36,7 +36,7 @@ {:path path :mtype (mime/get type) :name name - :filename (str/concat (str/slug name) (mime/get-extension type)) + :filename (str/concat (str/replace name #"[\\/:*?\"<>|]" "_") (mime/get-extension type)) :id task-id})) (defn create-zip