NextChat
                                
                                 NextChat copied to clipboard
                                
                                    NextChat copied to clipboard
                            
                            
                            
                        [Bug] markdown 代码块里含 `$数字`时 的错误转义
Bug Description
当GPT回复的代码块中含有 $数字 时,比如 $0,$1 , ChatGPT-Next-Web 会在其前面加上 \ ,如 \$0 ,\$1。
Steps to Reproduce
可以用这条提示语来检查它返回的结果:
写一个shell脚本,接受一个目录为参数,检查这个目录下是否有空目录,并打印结果,请使用中文回答。
或者看这条 ShareGPT的结果:https://sharegpt.com/c/qEjWO15
Expected Behavior
$数字 正确的转义,不需要添加 \
Screenshots

Deployment Method
- [ ] Docker
- [X] Vercel
- [ ] Server
Desktop OS
MacOS
Desktop Browser
Chrome
Desktop Browser Version
124.0.6367.62
Smartphone Device
No response
Smartphone OS
No response
Smartphone Browser
No response
Smartphone Browser Version
No response
Additional Logs
No response
Bot detected the issue body's language is not English, translate it automatically.
Title: [Bug] Error escaping when markdown code block contains $number
日经了属于是,主线版本依旧没有修复?
Bot detected the issue body's language is not English, translate it automatically.
Nikkei is yes, the mainline version is still not repaired?
Unless the maintainers come up with a solution, I recommend you use my workaround I made in this fork: https://github.com/Algorithm5838/NextChat/tree/dollar-sign
You can try it here: https://nextchat-git-dollar-sign-algorithm5838s-projects.vercel.app/
Unless the maintainers come up with a solution, I recommend you use my workaround I made in this fork: https://github.com/Algorithm5838/NextChat/tree/dollar-sign
You can try it here: https://nextchat-git-dollar-sign-algorithm5838s-projects.vercel.app/
Thank you , I have tried this one in vercel , but it seems still not fixed ...🥶

I see. I've discovered the reason why this happens. It occurs when the first set of triple backticks (```) is immediately followed by a word, such as 'bash' in this case. If you remove the 'bash' part, it should render correctly. I'll work on fixing this issue later.
This bug is complicated by the fact that the ReactMarkdown component, which was used in our project, does not support Latex syntax well. We've gone through several rounds of optimization with contributors in the community to solve this issue. However, unfortunately, the current solution does not cover all scenarios.We will continue to optimize as soon as possible to finally solve this problem
This bug is complicated by the fact that the ReactMarkdown component, which was used in our project, does not support Latex syntax well. We've gone through several rounds of optimization with contributors in the community to solve this issue. However, unfortunately, the current solution does not cover all scenarios.We will continue to optimize as soon as possible to finally solve this problem
It seems there are issues not only with supporting Latex syntax but also with bash support, as this problem occurred in BASH.
Moreover, this component has other problems; for any URL, regardless of the language, it always returns <http://example.com>, which actually does not need the < > around it.
for example in this demo: https://shareg.pt/ze7RikV
Perhaps it might be worth considering switching to a different Markdown component library.