diff --git a/.changeset/lucky-bottles-sparkle.md b/.changeset/lucky-bottles-sparkle.md new file mode 100644 index 00000000..fe69ed3b --- /dev/null +++ b/.changeset/lucky-bottles-sparkle.md @@ -0,0 +1,5 @@ +--- +"penpot-exporter": minor +--- + +Translate line endings done with shift+Enter in Figma diff --git a/plugin-src/transformers/transformInstanceNode.ts b/plugin-src/transformers/transformInstanceNode.ts index 2edd6998..2ebce7ac 100644 --- a/plugin-src/transformers/transformInstanceNode.ts +++ b/plugin-src/transformers/transformInstanceNode.ts @@ -27,7 +27,7 @@ export const transformInstanceNode = async ( } if (isExternalComponent(mainComponent)) { - await registerExternalComponents(mainComponent); + registerExternalComponents(mainComponent); } return { @@ -50,7 +50,7 @@ export const transformInstanceNode = async ( }; }; -const registerExternalComponents = async (mainComponent: ComponentNode): Promise => { +const registerExternalComponents = (mainComponent: ComponentNode): void => { let component: ComponentSetNode | ComponentNode = mainComponent; if (component.parent?.type === 'COMPONENT_SET') { diff --git a/plugin-src/translators/text/paragraph/translateParagraphProperties.ts b/plugin-src/translators/text/paragraph/translateParagraphProperties.ts index ddf626a7..6b7f0b77 100644 --- a/plugin-src/translators/text/paragraph/translateParagraphProperties.ts +++ b/plugin-src/translators/text/paragraph/translateParagraphProperties.ts @@ -45,7 +45,7 @@ const splitTextNodeByEOL = (node: PenpotTextNode): PenpotTextNode[] => { return split.map(text => ({ ...node, - text: text + text: text.replace(/\u2028/g, '\n') })); };