Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
- Fixed incorrect letter spacing syntax
- Fixed issue when layer name has no valid characters
  • Loading branch information
perrysmotors committed May 24, 2017
1 parent 69f7d46 commit 510536c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function textLayerCode(layer) {
}

if (layer.characterSpacing() != null) {
framerObject.letterSpacingCode = (layer.characterSpacing() * scale).toFixed(1);
framerObject.letterSpacing = (layer.characterSpacing() * scale).toFixed(1);
}

if (layer.lineHeight() != 0) {
Expand Down Expand Up @@ -407,7 +407,9 @@ function camelize(str) {
str = str.replace(/-/g, " ");
str = str.replace(/[^a-zA-Z0-9$_ ]/g, "")
str = str.trim();
if (firstCharIsInvalid(str)) {
if (str == "") {
str = "layer";
} else if (firstCharIsInvalid(str)) {
str = "layer_" + str;
}
return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) {
Expand Down
3 changes: 2 additions & 1 deletion CopyFramerCode.sketchplugin/Contents/Sketch/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name" : "Copy Framer Code",
"identifier" : "com.gilesperry.copy-framer-code",
"version" : "3.0",
"version" : "3.0.1",
"appcastURL": "https://api.sketchpacks.com/v1/plugins/com.gilesperry.copy-framer-code/appcast",
"compatibleVersion": 44,
"description" : "Copy layers to the clipboard as Framer code.",
"homepage": "https://github.com/perrysmotors/copy-framer-code",
Expand Down

0 comments on commit 510536c

Please sign in to comment.