Display formatted output in AI Chatbot
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3471143. --> Reported by: [vivek panicker](https://www.drupal.org/user/3540616) Related to !188 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>I am using the AI Assistant chatbot in my site.<br> I see that the AI is returning me a response like:</p> <pre>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the:<br><br>1. Lorem Ipsum is simply dummy text of the <br>2. Lorem Ipsum is simply dummy text of the <br>3. Lorem Ipsum is simply dummy text of the <br>4. Lorem Ipsum is simply dummy text of the <br><br><br>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ItLorem Ipsum is simply dummy text of the </pre><p>But when the chatbot displays it, it completely strips away all the newlines and just displays the entire thing as a continuous text:</p> <pre>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the: 1. Lorem Ipsum is simply dummy text of the&nbsp; 2. Lorem Ipsum is simply dummy text of the&nbsp; 3. Lorem Ipsum is simply dummy text of the&nbsp; 4. Lorem Ipsum is simply dummy text of the Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. ItLorem Ipsum is simply dummy text of the </pre><h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>- Add an AI assistant<br> - Ask a question that should return a formatted response, like reponse having bullet points.<br> The points won't appear.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Use field formatter to format the output.<br> Also need to consider the case for Markdown text.</p> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>NA</p> <h3 id="summary-ui-changes">User interface changes</h3> <p>AI assistant will display formatted output.</p> <h3 id="summary-api-changes">API changes</h3> <p>NA</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>NA</p>
issue