dmitrizzle / chat-bubble

Simple chatbot UI for the Web with JSON scripting 👋🤖🤙
MIT License
579 stars 171 forks source link

How do I make the output of the chatbot make new lines ("\n")? #94

Closed ilyasjamil closed 2 years ago

ilyasjamil commented 2 years ago

So my Rasa chatbot code returns a paragraph with "\n" at the end of each line to make a new line. But when I use your Chat-bubble interface with the Rasa demo it gets ignored and every line is stacked together with the other one. What should I make the chatbot say to make a newline if \n does not work?

dmitrizzle commented 2 years ago

Hey @ilyasjamil, have you tried replacing \n with <br />? text.replace(/\\n/g, "<br />");

dmitrizzle commented 2 years ago

Alternatively, you may format your text into paragraphs with <p>-tags or whichever way you like with HTML and CSS.

ilyasjamil commented 2 years ago

Hey @ilyasjamil, have you tried replacing \n with <br />? text.replace(/\\n/g, "<br />");

thank you!