Skip to content

Commit

Permalink
Translate line endings done with shift+Enter in Figma (#154)
Browse files Browse the repository at this point in the history
* Translate line endings done with shift+Enter in Figma

* add changelog
  • Loading branch information
jordisala1991 authored Jun 13, 2024
1 parent e9fe86c commit 342ab90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-bottles-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"penpot-exporter": minor
---

Translate line endings done with shift+Enter in Figma
4 changes: 2 additions & 2 deletions plugin-src/transformers/transformInstanceNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const transformInstanceNode = async (
}

if (isExternalComponent(mainComponent)) {
await registerExternalComponents(mainComponent);
registerExternalComponents(mainComponent);
}

return {
Expand All @@ -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;

if (component.parent?.type === 'COMPONENT_SET') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const splitTextNodeByEOL = (node: PenpotTextNode): PenpotTextNode[] => {

return split.map(text => ({
...node,
text: text
text: text.replace(/\u2028/g, '\n')
}));
};

Expand Down

0 comments on commit 342ab90

Please sign in to comment.