0
Fork 0
mirror of https://github.com/penpot/penpot-exporter-figma-plugin.git synced 2024-12-22 05:33:02 -05:00

Fix empty text layers (#120)

* Fix empty texts

* add changelog
This commit is contained in:
Jordi Sala Morales 2024-05-27 18:13:19 +02:00 committed by GitHub
parent 35d9d47e2a
commit 044b09207b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 10 deletions

View file

@ -0,0 +1,5 @@
---
"penpot-exporter": patch
---
Fix text layers without text content

View file

@ -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)
};