When manually entering a Trello card's description, it's easy to introduce line breaks: just press ENTER. However, I need to introduce line breaks when setting a card's description via the Trello API. So far, \n and < br > don't get parsed. Any ideas?
If you happen to find this and are looking to add a line break using the URL from the API, use %0A
.
For example:
https://api.trello.com/1/cards?key=(key)&token=(token)&name=(card name)&desc=Line 1 %0A Line 2 %0A Line 3&idList=<id>
Struggled with this problem for ages. The php in WisdmLabs' answer works if it's passed as php to an element and then to js through getElementByID, but that's not possible if you need to set the variable clientside.
Finally found \x0A works in js.
Hope this saves someone from the hours of googling I endured!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With