Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] markdown 代码块里含 $数字时 的错误转义 #4537

Open
1 of 3 tasks
falconchen opened this issue Apr 18, 2024 · 7 comments
Open
1 of 3 tasks

[Bug] markdown 代码块里含 $数字时 的错误转义 #4537

falconchen opened this issue Apr 18, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@falconchen
Copy link

Bug Description

当GPT回复的代码块中含有 $数字 时,比如 $0$1 , ChatGPT-Next-Web 会在其前面加上 \ ,如 \$0\$1

Steps to Reproduce

可以用这条提示语来检查它返回的结果:

写一个shell脚本,接受一个目录为参数,检查这个目录下是否有空目录,并打印结果,请使用中文回答。

或者看这条 ShareGPT的结果:https://sharegpt.com/c/qEjWO15

Expected Behavior

$数字 正确的转义,不需要添加 \

Screenshots

https://photo.cellmean.com/i/2024/04/18/rb0ulf-0.png

Deployment Method

  • Docker
  • 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

@falconchen falconchen added the bug Something isn't working label Apr 18, 2024
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Error escaping when markdown code block contains $number

@daiaji
Copy link

daiaji commented Apr 18, 2024

日经了属于是,主线版本依旧没有修复?

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Nikkei is yes, the mainline version is still not repaired?

@Algorithm5838
Copy link
Contributor

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/

@falconchen
Copy link
Author

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 ...🥶

@Algorithm5838
Copy link
Contributor

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.

@Dean-YZG
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants