Permalink
Browse files

Ignore importe layer name suffixes

Like .png or -, *
  • Loading branch information...
Koen Bok
Koen Bok committed Mar 22, 2016
1 parent 3722567 commit 25f28a761926952e11d03749b6c6e01d43c01c06
Showing with 7 additions and 1 deletion.
  1. +7 −1 framer/Importer.coffee
@@ -30,6 +30,12 @@ getScaleFromName = (str) ->
startsWithNumber = (str) ->
return (new RegExp("^[0-9]")).test(str)
sanitizeLayerName = (name) ->
for suffix in ["*", "-", ".png", ".jpg", ".pdf"]
if _.endsWith(name.toLowerCase(), suffix)
name = name[0..name.length-suffix.length-1]
return name
class exports.Importer
constructor: (@path, @scale=1, @extraLayerProperties={}) ->
@@ -102,7 +108,7 @@ class exports.Importer
layerInfo =
shadow: true
name: info.name
name: sanitizeLayerName(info.name)
frame: info.layerFrame
clip: false
backgroundColor: null

0 comments on commit 25f28a7

Please sign in to comment.