# Is there a best way to render a response containing texts, code snippets or image (dynamicly)

**URL:** <https://community.weweb.io/t/is-there-a-best-way-to-render-a-response-containing-texts-code-snippets-or-image-dynamicly/7652>\
**Category:** How do I?\
**Created:** [March 20, 2024, 12:10am UTC](https://community.weweb.io/t/is-there-a-best-way-to-render-a-response-containing-texts-code-snippets-or-image-dynamicly/7652 "2024-03-20T00:10:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zacharyb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/zacharyb/32/3567_2.png) [@Zacharyb](https://community.weweb.io/u/Zacharyb)\
**Post date:** [March 20, 2024, 12:10am UTC](https://community.weweb.io/t/is-there-a-best-way-to-render-a-response-containing-texts-code-snippets-or-image-dynamicly/7652/1 "2024-03-20T00:10:12Z")

</div>

Hello !  
Just had a little question, will try to stay concise with a basic example :  
In a AI chat interaction, the assistant in its answer have a text basic string, and also give a code snippet, is there a way using like Rich text element, to check the semantic, if it’s a dev language then display the text portion into a component or css class ?

Thanks and have a good day !

---

<div class="post-metadata">

**Author:** ![Alexis](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/alexis/32/13248_2.png) [@Alexis](https://community.weweb.io/u/Alexis)\
**Post date:** [March 21, 2024, 6:41pm UTC](https://community.weweb.io/t/is-there-a-best-way-to-render-a-response-containing-texts-code-snippets-or-image-dynamicly/7652/2 "2024-03-21T18:41:10Z")

</div>

Maybe you can ask your AI to reply in a markdown format, at least return the part of the code wrapped inside “```”, if you use the rich text to display it, it will be interpreted as a code block 🙂

---

<div class="post-metadata">

**Author:** ![Zacharyb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/zacharyb/32/3567_2.png) [@Zacharyb](https://community.weweb.io/u/Zacharyb)\
**Post date:** [March 21, 2024, 8:28pm UTC](https://community.weweb.io/t/is-there-a-best-way-to-render-a-response-containing-texts-code-snippets-or-image-dynamicly/7652/3 "2024-03-21T20:28:58Z")

</div>

mmh will try it eventually i guess, it works fine for H1, bold etc for eg, but i have a feeling that i would need to wait the server side components feature for it

if only it were a bit higher in the feature roadmap ahahh

thanks anyways will keep updated !
