From 47cd7d960fce2aa4865872e394d8bbb786edd086 Mon Sep 17 00:00:00 2001 From: Cedric Sam Date: Tue, 9 Sep 2025 11:09:07 -0400 Subject: [PATCH] slugify the box (group container) ID too * If ai2html is used on an Illustrator file name containing invalid element ID characters (anything not alphanumeric/hyphen/underscore), then the group container's ID breaks down. * Intrigued that aside from the top "tktk-box" container ID, all the other IDs on images, text elements, etc., seem properly escaped. --- ai2html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai2html.js b/ai2html.js index 4ef9225..6d9e6f2 100644 --- a/ai2html.js +++ b/ai2html.js @@ -1944,7 +1944,7 @@ function getRawDocumentName() { } function getGroupContainerId(groupName) { - return nameSpace + groupName + '-box'; + return nameSpace + makeKeyword(groupName.replace(/ +/g,"-")) + '-box'; } // Prevent duplicate artboard names by appending width