dify icon indicating copy to clipboard operation
dify copied to clipboard

Any plan for better math / latex format support?

Open xukp20 opened this issue 1 year ago • 1 comments

Self Checks

  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

It seems that the response block of the chatbot cannot render the inline math expression between a pair of single "$" signs.

Also, the type of math expressions between "[" and "]" which is often used by OpenAI's models faces the same problem. Although I've found that issue #2646 has mentioned the same problem, it only provides me with a workaround by forcing the model to use double $ instead of responding in the way it liked. Maybe it is better to solve this problem by modifying the frontend a little bit. Rendering each block as markdown may help?

2. Additional context or comments

image

3. Can you help us with this feature?

  • [X] I am interested in contributing to this feature.

xukp20 avatar Aug 24 '24 12:08 xukp20

https://github.com/langgenius/dify/blob/603a89055cb6746650171969fbb59a310e717a8e/web/app/components/base/markdown.tsx

Well I think we better refactor this once we have some spare time. :)

crazywoola avatar Aug 26 '24 09:08 crazywoola

https://github.com/langgenius/dify/issues/9206

crazywoola avatar Oct 11 '24 03:10 crazywoola

v0.8.3can crorect display latetx

likenamehaojie avatar Oct 11 '24 10:10 likenamehaojie