mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	Merge pull request #4393 from ChatGPTNextWeb/dean-delete-escapeDollarNumber
bugfix: Delete the escapeDollarNumber function, which causes errors i…
This commit is contained in:
		@@ -207,23 +207,6 @@ function CustomCode(props: { children: any; className?: string }) {
 | 
			
		||||
  );
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function escapeDollarNumber(text: string) {
 | 
			
		||||
  let escapedText = "";
 | 
			
		||||
 | 
			
		||||
  for (let i = 0; i < text.length; i += 1) {
 | 
			
		||||
    let char = text[i];
 | 
			
		||||
    const nextChar = text[i + 1] || " ";
 | 
			
		||||
 | 
			
		||||
    if (char === "$" && nextChar >= "0" && nextChar <= "9") {
 | 
			
		||||
      char = "\\$";
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    escapedText += char;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return escapedText;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function escapeBrackets(text: string) {
 | 
			
		||||
  const pattern =
 | 
			
		||||
    /(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g;
 | 
			
		||||
@@ -261,7 +244,7 @@ function tryWrapHtmlCode(text: string) {
 | 
			
		||||
 | 
			
		||||
function _MarkDownContent(props: { content: string }) {
 | 
			
		||||
  const escapedContent = useMemo(() => {
 | 
			
		||||
    return tryWrapHtmlCode(escapeBrackets(escapeDollarNumber(props.content)));
 | 
			
		||||
    return tryWrapHtmlCode(escapeBrackets(props.content));
 | 
			
		||||
  }, [props.content]);
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user