- Website FAQ chatbot vs simple site search
- Website chatbot vs Facebook Messenger Bot
- How to create clickable hyperlinks in Dialogflow website chatbot
- How to add buttons to your Dialogflow website chatbot
- How to display images inside your Dialogflow website chatbot
- How to add line breaks inside your Dialogflow website chatbot
- Dialogflow webhook for website chatbots
- Reader Question: Do you know a good bot for websites I can try out?
- DialogFlow Web chatbox: Some UI design ideas
- How much does it cost to create an FAQ chatbot for my website?
Imagine if there were absolutely no line breaks in this post. It would make for very hard reading, wouldn't it? Unfortunately, Dialogflow's built in web demo doesn't allow line breaks. As a result, it is very hard to show multi-line responses nicely in the integration.
In this post, I will explain briefly how you can add line breaks in your website chatbot.
You need to understand the system explained in my free "Rich Webchat using Dialogflow" course.
The process for adding line breaks is simple. Just add the line break into your Dialogflow text response.
If you didn't know how, you just need to use SHIFT + ENTER and you will notice that Dialogflow automatically creates those line breaks for you.
When you get the corresponding response JSON, you see the line breaks inside the JSON. (These are not visible in the test console or the web demo integration though).
And best of all, most of the Markdown parser can automatically handle the "\n" as a line break, so there is nothing more for you to do!