Line breaks in Microsoft planner description field - a bug or a feature?

94 Views Asked by At

I am using microsoft planner graph API to get data from Microsoft Planner. This all works good, but when I get the description field, I'm puzzled over its value. Am I missing something, or maybe there is just a new bug in planner API?

The description field in planner looks like this: total 5 lines, the second line is empty, the fourth line has two spaces (the one between "two" and "three"):

enter image description here

Now what I see in the description field when I call the planner API? This:

\r\nLine One\r\n\r\n  \r\n\r\n\r\nLine Two\r\n\r\n  \r\n\r\nLine Three\r\n

How do I "decode" that string to a reasonable multi-line text?

If I try to split that by \r\n\r\n (?) and trim, that does not work (i.e. the result is not what you see in the picture above). So I wonder how that string is built, if it is not a concatenation using \r\n? Note there is \r\n\r\n\r\n (six chars) sequence? May this whole thing be a planner bug? My memory may be fuzzy, but I think it worked differently a few months ago.

Also note, some whitespace chars in the string above are not spaces \32 but non-breaking spaces \160

0

There are 0 best solutions below