Skip to content

Commit

Permalink
Fix empty text layers (#120)
Browse files Browse the repository at this point in the history
* Fix empty texts

* add changelog
  • Loading branch information
jordisala1991 authored May 27, 2024
1 parent 35d9d47 commit 044b092
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/gorgeous-rings-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"penpot-exporter": patch
---

Fix text layers without text content
22 changes: 12 additions & 10 deletions plugin-src/transformers/partials/transformText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@ export const transformText = async (node: TextNode): Promise<Partial<TextShape>>
content: {
type: 'root',
verticalAlign: translateVerticalAlign(node.textAlignVertical),
children: [
{
type: 'paragraph-set',
children: [
children: styledTextSegments.length
? [
{
type: 'paragraph',
children: await translateStyleTextSegments(node, styledTextSegments),
...(styledTextSegments.length ? transformTextStyle(node, styledTextSegments[0]) : {}),
...(await transformFills(node))
type: 'paragraph-set',
children: [
{
type: 'paragraph',
children: await translateStyleTextSegments(node, styledTextSegments),
...transformTextStyle(node, styledTextSegments[0]),
...(await transformFills(node))
}
]
}
]
}
]
: undefined
},
growType: translateGrowType(node)
};
Expand Down

0 comments on commit 044b092

Please sign in to comment.