Skip to content

Conversation

@cedricsam
Copy link
Contributor

@cedricsam cedricsam commented Sep 9, 2025

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

* 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.
@cedricsam
Copy link
Contributor Author

I also saw that the final HTML page output name (pageName) isn't escaped... was tempted to add the change further upstream, but I figured it may lead to unintended consequences with clashing escaped names for the HTML output. But you are escaping other assets names... so perhaps we don't care if they did clash? Let me know and I can change this to further up!

Capture d’écran, le 2025-09-09 à 11 22 41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant