Botframework-sdk: [Facebook Messenger] Newlines stripped out when sending messages

Created on 6 Aug 2016  路  21Comments  路  Source: microsoft/botframework-sdk

Sending messages seems to strip out multiple newlines (to create whitespace). Newlines are supported on FB Messenger but when I route them through Bot Framework they seem to disappear.

bug customer-replied-to

Most helpful comment

That seems to produce indented paragraphs. Is there a way to produce block paragraphs (i.e., create blank lines)? A lot of my content is really hard to read otherwise.

All 21 comments

I've seen this too. Adding Tom.

Any news? I've just hit that. It works in the emulator but on skype the newlines are missing. I use two whitespaces and then a \n.

Since by default everything parsed as markdown you can put \n\n to have new paragraph in Skype and Facebook:

"Lorem ipsum dolor sit amet, \n\n consectetur adipiscing elit. \n\n Duis eleifend efficitur orci, id semper leo feugiat at. Morbi pharetra massa sit amet nisi semper, sed pellentesque tellus egestas. \n\n Praesent ipsum enim, mollis ac imperdiet in, faucibus ut odio. Proin ut dui nisi."

Facebook:
image

Skype:
image

Slack:
image

webchat:
image

That seems to produce indented paragraphs. Is there a way to produce block paragraphs (i.e., create blank lines)? A lot of my content is really hard to read otherwise.

@MironV

I have the same question. @msft-shahins closed my issue, which detailed this exactly.

@MironV this should be fixed now. Use standard markdown \n (two whitespace and \n) to insert a line break.

Text = "Lorem ipsum dolor sit amet,  \nConsectetur adipiscing elit.  \nDuis eleifend efficitur orci, id semper leo feugiat at. Morbi pharetra massa sit amet nisi semper, sed pellentesque tellus egestas.  \nPraesent ipsum enim, mollis ac imperdiet in, faucibus ut odio. Proin ut dui nisi."

Facebook
image

Skype
image

Webchat
image

Are you sure this is completely solved? We are now seeing an additional blank newline at the end of most messages (tested via skype). I haven't tested the on-purpose newlines yet.

@letmaik Feel free to file another issue with the markdown causing the behavior that you are observing.

@letmaik that sounds like issue #1025 which I filed some time ago. Looks like it hasn't been fixed yet.

I am still not able to create blank lines. Is this really fixed?

@msft-shahins your example does not contain blank lines.

I can create a new line but can't seem to create a line between them...

Hey,  \n  \nI\'m TestBot

Hey,
I鈥檓 TestBot

Any ideas how to get an extra blank line?

@gilesbutler try line 1<br/><br/>line 3

Thanks @euanlau - unfortunately due to a family bereavement I can't test this right now. Once I'm back online I'll test and update here.

Hi, I am also trying to get lines between sentences to break up longer paragraphs

Same issue here, after a lot of trial and error the only way to create blank lines (in the emulator) I have found is the following one:

var text1 = `Line1

&nbsp;
&nbsp;

Line3`;

which gives you:
Line1

Line3

But don't ask me why ;)

I'm not sure I understand. It's pretty clear what the issue is and that people are continuing to encounter it. What more is specifically required that can't be parsed from this thread?

@MironV are you using C# or Node SDK?

Not sure what @MironV uses but I'm seeing this error in Node SDK

I have the same issue, I can't have a new line in Facebook channel. I tried all solutions I saw on this thread and in other places (<br>, <br />, nbsp; , \n \n, \r\n, \r \n...)
Is there a solution available and approved ?

Here is a new element I found:

Leads to this:

And if I take out the letters:

It then leads to this:

Trying to replace 'qwe' by nbsp; doesn't work, it just displays nbsp; in chat.

@hofman-p You are commenting on a closed issue. If you have a question or problem, please open a new issue. Also, for reference, please don't double post to GitHub and Stack Overflow, as we monitor both forums concurrently. Thanks

Duplicate of: https://stackoverflow.com/questions/44700290/cant-add-line-break-when-sending-messages-on-facebook-channel/44769608#44769608

Was this page helpful?
0 / 5 - 0 ratings