ai2html icon indicating copy to clipboard operation
ai2html copied to clipboard

slugify the box (group container) ID too

Open cedricsam opened this issue 4 months ago • 1 comments

  • 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.

Currently, if you run ai2html on a file with spaces and other non-alphanumeric/hyphen/underscore characters (e.g. named test-1288px copie. (weird chars) .ai):

Capture d’écran, le 2025-09-09 à 10 45 47

The fix would escape these invalid characters, like it does on the IDs and class names of img, div elements in the HTML output:

Capture d’écran, le 2025-09-09 à 10 45 25
  • Intrigued that aside from the top "tktk-box" container ID, all the other IDs on images, text elements, etc., seem properly escaped! I dug a bit, but not exhaustively as to why/where the escape functions were being applied...

cedricsam avatar Sep 09 '25 15:09 cedricsam