API update shape text with line breaks

  • 20 November 2023
  • 1 reply
  • 43 views

Badge +1

I’m trying to update a shape with a line break

shape_content = "This is a shape with\na line break."

data = { "data": { "content": shape_content } }

but Miro doesn’t give me a line break. 

I can manually do it just by hitting enter. 

 

Can anybody help me with this?

 


1 reply

Userlevel 6
Badge +4

Hey @Jason1979,

Thanks for raising this. At the moment, the shape text content doesn’t support the line break notation via API. However, it’s a great suggestion.

If you’re looking to handle this type of text programmatically with line breaks in certain areas, one workaround could be to use sticky notes instead. These support HTML and line break notation inside the text content. 

However, I can definitely appreciate the value in extending this to shape widgets, and I’m happy to pass this feedback along to the team!

Reply