All `/` in icon name replaced with `_` before regexps applied
osipxd opened this issue · comments
We have icon with name icons / 24 / arrow back
and I want to save it as n2_icon_arrow_back_24.xml
I've configured validate and replace patterns:
nameValidateRegexp: '^icons / (\d\d) / ([A-Za-z0-9 /_-]+)$'
nameReplaceRegexp: 'n2_icon_$2_$1'
- Problem:
Error: ❌ Bad asset name «icons _ 32 _ arrow back»
Workaround: Replace/
in validatingRegexp to_
(why/
replaced with_
?)nameValidateRegexp: '^icons _ (\d\d) _ ([A-Za-z0-9 /_-]+)$'
- Problem:
Error: The file “n_2_icon_arrow_back_32.xml” doesn’t exist.
(whyn_2
but notn2
?)
Workaround: Haven't found. I've tried to removen2
fromnameReplaceRegexp
, but the error is still here.
- FigmaExport automatically replaces symbol «/» with «_» before executing rexexps patterns because file name must not contains «/» symbol.
- This is a bug. I will fix it.
- FigmaExport automatically replaces symbol «/» with «_» before executing rexexps patterns because file name must not contains «/» symbol.
Maybe will be better to replace symbols after nameReplaceRegexp
is applied? I think it will be more intuitive.
Maybe will be better to replace symbols after nameReplaceRegexp is applied? I think it will be more intuitive.
It will break backward compatibility. Every developer that use FigmaExport will need to update their regexps. This is not good.
I will fix 2-nd bug by the end of the week.
#145
I've fixed the second bug. Please update to the latest version (0.31.7) and check again.
I've fixed the second bug. Please update to the latest version (0.31.7) and check again.
Thanks, seems to be fixed.
Question about 1st problem. Is figma-export replaces only slashes /
with underscores _
?
Is figma-export replaces only slashes / with underscores _?
Yep
Yep
It would be great if this behavior will be documented
I’ll update documentation.
Added info about replacing "/"
by "_"
to CONFIG.md
Thanks! I close this issue.