diff --git a/app/client/api.ts b/app/client/api.ts index 48bbde6bc81..7a242ea99dd 100644 --- a/app/client/api.ts +++ b/app/client/api.ts @@ -231,7 +231,7 @@ export function getHeaders(ignoreHeaders: boolean = false) { function getConfig() { const modelConfig = chatStore.currentSession().mask.modelConfig; - const isGoogle = modelConfig.providerName == ServiceProvider.Google; + const isGoogle = modelConfig.providerName === ServiceProvider.Google; const isAzure = modelConfig.providerName === ServiceProvider.Azure; const isAnthropic = modelConfig.providerName === ServiceProvider.Anthropic; const isBaidu = modelConfig.providerName == ServiceProvider.Baidu; diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 7d27f1d60fa..a25b8537bc1 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -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 (