figma / plugin-typings

Typings for the Figma Plugin API
MIT License
195 stars 45 forks source link

New line characters are not included in TextNode.characters #92

Closed k15a closed 2 years ago

k15a commented 2 years ago

Reproduction:

Screen Shot 2021-11-12 at 17 06 07
for (const node of figma.currentPage.selection) {
  console.log(node)
}
Screen Shot 2021-11-12 at 17 01 40

Is there a way to get new lines of a TextNode?

cyberalien commented 2 years ago

If you are using OSX, shift+enter creates soft line break, not \n. Character is String.fromCodePoint(8232)

k15a commented 2 years ago

If you are using OSX, shift+enter creates soft line break, not \n. Character is String.fromCodePoint(8232)

Ohh, my bad. Thank you!