From fd01c2e2f1b9bfb972377492c7769b6b62170193 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:00:41 +0100 Subject: Stitch plan: escape labels (#2644) --- lib/stitch_plan/generate_stitch_plan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/stitch_plan/generate_stitch_plan.py') 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 -- cgit v1.2.3