mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-18 05:22:28 -05:00
Translate line endings done with shift+Enter in Figma (#154)
* Translate line endings done with shift+Enter in Figma * add changelog
This commit is contained in:
parent
e9fe86c43a
commit
342ab90e69
3 changed files with 8 additions and 3 deletions
5
.changeset/lucky-bottles-sparkle.md
Normal file
5
.changeset/lucky-bottles-sparkle.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"penpot-exporter": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Translate line endings done with shift+Enter in Figma
|
|
@ -27,7 +27,7 @@ export const transformInstanceNode = async (
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExternalComponent(mainComponent)) {
|
if (isExternalComponent(mainComponent)) {
|
||||||
await registerExternalComponents(mainComponent);
|
registerExternalComponents(mainComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -50,7 +50,7 @@ export const transformInstanceNode = async (
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const registerExternalComponents = async (mainComponent: ComponentNode): Promise<void> => {
|
const registerExternalComponents = (mainComponent: ComponentNode): void => {
|
||||||
let component: ComponentSetNode | ComponentNode = mainComponent;
|
let component: ComponentSetNode | ComponentNode = mainComponent;
|
||||||
|
|
||||||
if (component.parent?.type === 'COMPONENT_SET') {
|
if (component.parent?.type === 'COMPONENT_SET') {
|
||||||
|
|
|
@ -45,7 +45,7 @@ const splitTextNodeByEOL = (node: PenpotTextNode): PenpotTextNode[] => {
|
||||||
|
|
||||||
return split.map(text => ({
|
return split.map(text => ({
|
||||||
...node,
|
...node,
|
||||||
text: text
|
text: text.replace(/\u2028/g, '\n')
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue