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

Fix template dropping text containing "$" #56

Closed newsroomdev closed 6 years ago

newsroomdev commented 7 years ago

Addresses #43

String.replace's second parameter, the replacement string, uses $ as a special character for submatches of RegExp patterns. Per MDN's documentation on replace:

"The replacement string can include the following special replacement patterns...$n Where n is a non-negative integer lesser than 100, inserts the nth parenthesized submatch string, provided the first argument was a RegExp object."

By specifying a function (anonymous or otherwise) as the second parameter, we separate out submatches as function parameters and thus avoid the need for using $$ instead of $ in templates.

mbloch commented 6 years ago

Thanks for the PR... I see that issue #43 was closed, this should be fixed.