OvidijusParsiunas / deep-chat

Fully customizable AI chatbot component for your website
https://deepchat.dev
MIT License
1.26k stars 170 forks source link

Feature Request: Add support for rendering mathematical symbols using katex or mathjax #196

Closed ZYPX closed 1 month ago

ZYPX commented 1 month ago

Would love to have math expressions rendered dynamically in messages. I attempted to add this myself but was not successful.

Some available libraries are https://www.mathjax.org/ and https://katex.org/

Currently math from the LLM gets outputted like this: exampleMath

I would like the output to be like this: image

OvidijusParsiunas commented 1 month ago

Hi @ZYPX.

Because Deep Chat uses a library called Remarkable to render its text content, the formatting is limited by its capabilities.

Unfortunately due to this, I would either recommend forking/cloning the repository and editing the component yourself (steps here) or rendering the responses yourself via the html message responses (more info can be found here).

If another way to do this is found, you can re-open this issue and inform me of the changes that can be made. However, for now I will keep this issue closed.

Thankyou!