newsdev / ai2html

A script for Adobe Illustrator that converts your Illustrator artwork into an html page.
http://ai2html.org
Other
898 stars 146 forks source link

In ai2html-beta, custom blocks can be broken with ETX character #62

Closed cedricsam closed 7 years ago

cedricsam commented 7 years ago

In ai2html-beta, custom blocks (for settings, css, etc.) are split with \r and \n, but doesn't consider the "end-of-text" character, created on soft return (ShiftEnter), which is something that people might use instead of a regular hard return (just Enter). It is often escaped as ^C (in vim), but is not displayed in other places (such as a browser).

Using the soft return causes blocks to be misread or not read at all. In the case of a CSS block, if people used a regular carriage return after ai2html-css, the soft return gets output to the generated "Custom CSS" inline CSS. But you might not see it in the source -- you gotta inspect code to see it. And the ETX interferes with how the browser interprets that CSS (since it's not considered a space/whitespace?).

Fix provided here, where we replace the ETX character with a carriage return: https://github.com/bizweekgraphics/ai2html/commit/76e0f8558ee7248bb2955e1cdab4bb44944b2570

cedricsam commented 7 years ago

cc: @mbloch

mbloch commented 7 years ago

Commit 31294381e46466a98c313ca adds a fix for this to ai2html-beta.js. Thanks for the bug report :)