I use Microsoft bot Framework and deployed it to Web Chat, my bot was printing the messages in a correct format as wanted with Break Lines "\n\n", then I use the following tutorial https://github.com/microsoft/BotFramework-WebChat/blob/master/README.md to integrate JavaScript with my bot to remove the attachment icon (as shown in the figure below)
After using JavaScript and removing the attachment icon I found that Break Lines (\n) was stopped working,
Does anyone know what did happen?
The previous format (without using JavaScript):
line1
line2
The current format (using JavaScript):
line1
line2
The following code was added in "wwwroot" to remove the attachment icon:
<!DOCTYPE html>
<html lang="en-US">
<head>
<script crossorigin="anonymous" src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
</head>
<body>
<div id="webchat" role="main"></div>
<script>
(async function () {
window.WebChat.renderWebChat(
{
directLine: window.WebChat.createDirectLine({ token: "MY-TOKEN" }),
styleOptions: {
markdownRespectCRLF: true,
// hide upload button
hideUploadButton: true
}
},
document.getElementById('webchat')
);
document.querySelector('#webchat > *').focus();
})().catch(err => console.error(err));
</script>
</body>
</html>
My c# code to Send Activity:
string reply = "Line 1 \n\n Line 2";
await turnContext.SendActivityAsync(MessageFactory.Text(reply), cancellationToken);