Open mrkmhny opened 2 years ago
Based on how this looks -> you should have escaped the \n - else it will be passed as an actual newline putting "something in NY." into the next line
Based on how this looks -> you should have escaped the \n - else it will be passed as an actual newline putting "something in NY." into the next line
The \n in this case is coming from the Description text box inside of confluence. There isn't any opportunity to escape the newline because it's just a simple plain text box in the UI. Image below
if the ”\n" is part of the ical then it is fine, I'm just referring to the JS you posted.
-> the \n is within your string passed as an actual new line to parseICS -> therefor only showing up as " Do ".
whereas when you escape the \n with \n it will also extract the correct " Do \nsomething in NY."
if the ”\n" is part of the ical then it is fine, I'm just referring to the JS you posted.
-> the \n is within your string passed as an actual new line to parseICS -> therefor only showing up as " Do ".
whereas when you escape the \n with \n it will also extract the correct " Do \nsomething in NY."
Sorry yeah, I hard coded the ical data for the sake of posting a clear, concise, and reproducible example. In reality this data would be coming from an API call to an external service. So in practice, escaping the \n chars would not be an option.
I've tried hacking together a simple function that could parse the DESCRIPTION field and find/replace all the \n characters, but there wasn't really a reliable/safe way to do this, since it's difficult to differentiate the \n chars that are part of the DESCRIPTION plain text vs the actual \n characters that indicate the next field in the ical data. Not to mention, any other appearance of the string "DESCRIPTION:" in the ical data would also throw off this parsing
Can you perhaps just post the lines of the description where you see the actual failure? (and replace all the non \n text with something else?)
with PRODID:Microsoft Exchange Server 2010
we had a problem recently with something along the following:
DESCRIPTION;LANGUAGE=en-US:
\nand here we do have some text
and here the next line
does that look like your error? (this is invalid syntax for ical -> meaning not parsing it is correct in this case, we work around with appending a space for every \n that is in the beginning of a line)
Example...
... will only parse "Do " from the description because node-ical interprets the newline as the start of a new field