0

I like to get some Line breaks in the notes content on task creation, I tried <br>, </br> , /r/n , /n/r and some ASCII too. Nothing worked, I am using JSON object through JAVA code.

Eric Finn
  • 8,629
  • 3
  • 33
  • 42
  • 1
    Have you tried `\n` and/or `\r\n`? I'm not familiar with asana, but in most software, escape sequences start with backslashes. – Eric Finn Jul 16 '13 at 17:03

1 Answers1

0

As Eric pointed out, you'll want to use \n, which is the correct encoding for a newline in this case (as it should be in any JSON API you come across).

agnoster
  • 3,744
  • 2
  • 21
  • 29
  • That's a separate issue from this one. API objects are sent as the "data" property of the request. See the developer documentation for examples of this. At any rate, a `\n` in a string shouldn't cause this error - if that's the issue, I've misunderstood. – agnoster Jul 18 '13 at 19:26
  • we can pass anything in the date but its not rendering as line break instead it just displays as /n. I think the way it renders in asana is different not like normal HTML, looks like there is some logic in the DIV in that area. – user2588221 Jul 24 '13 at 19:03
  • The date field shouldn't be able to contain newlines, I don't think. Also, make sure you're using the backslash, not the slash - it's `\n`, not `/n`. That's a critical distinction! – agnoster Jul 24 '13 at 22:43
  • Also, I've confirmed for myself that this does in fact work. If you're hitting an edge case, including the exact JSON payload you're sending would probably help me see what's going on for you. – agnoster Jul 24 '13 at 22:44