summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/generate_stitch_plan.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2023-12-29 17:00:41 +0100
committerGitHub <noreply@github.com>2023-12-29 17:00:41 +0100
commitfd01c2e2f1b9bfb972377492c7769b6b62170193 (patch)
treefff515f83c8d5a8f91ac7476224d9cec3d70e76f /lib/stitch_plan/generate_stitch_plan.py
parent3f37c05a7d411412faa521d1c3b9dd59b426725f (diff)
Stitch plan: escape labels (#2644)
Diffstat (limited to 'lib/stitch_plan/generate_stitch_plan.py')
-rw-r--r--lib/stitch_plan/generate_stitch_plan.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/stitch_plan/generate_stitch_plan.py b/lib/stitch_plan/generate_stitch_plan.py
index 53458815..cdd66d9e 100644
--- a/lib/stitch_plan/generate_stitch_plan.py
+++ b/lib/stitch_plan/generate_stitch_plan.py
@@ -5,6 +5,7 @@
import os
import sys
+from html import escape
import inkex
@@ -59,7 +60,7 @@ def generate_stitch_plan(embroidery_file, import_commands="symbols"): # noqa: C
# rename the Stitch Plan layer so that it doesn't get overwritten by Embroider
layer = svg.find(".//*[@id='__inkstitch_stitch_plan__']")
- layer.set(INKSCAPE_LABEL, os.path.basename(embroidery_file))
+ layer.set(INKSCAPE_LABEL, escape(os.path.basename(embroidery_file)))
layer.attrib.pop('id')
# Shift the design so that its origin is at the center of the canvas