You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sketch breaks when you try and run it (you get the following):
SyntaxError: Unexpected end of script
at /Users/cmcculloh/Library/Application Support/com.bohemiancoding.sketch3/Plugins/Untitled.sketchplugin:7
Script executed in 5.573034s
Note that this is just simplified example code that (yes I recognize) makes no sense (why would you want to run a replace on newName instead of just giving it the right name?), and is merely mean to illustrate the brokenness of Sketch's JS RexExp engine. My actual code is part of a plugin that, among other things, validates/fixes all layer names (removing spaces, em & en dashes, etc).
The text was updated successfully, but these errors were encountered:
cmcculloh-kr
changed the title
Regex broken when using quotes and doublequotes
Regex broken when using quotes and/or doublequotes
Dec 14, 2020
Take the following valid JS:
Sketch breaks when you try and run it (you get the following):
So you have to double up the quotes, like this:
Note that this is just simplified example code that (yes I recognize) makes no sense (why would you want to run a replace on newName instead of just giving it the right name?), and is merely mean to illustrate the brokenness of Sketch's JS RexExp engine. My actual code is part of a plugin that, among other things, validates/fixes all layer names (removing spaces, em & en dashes, etc).
The text was updated successfully, but these errors were encountered: