Skip to content

Commit 2bac174

Browse files
authored
Merge pull request #4393 from ChatGPTNextWeb/dean-delete-escapeDollarNumber
bugfix: Delete the escapeDollarNumber function, which causes errors i…
2 parents 05e6e4b + 65f80f8 commit 2bac174

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

app/components/markdown.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,23 +207,6 @@ function CustomCode(props: { children: any; className?: string }) {
207207
);
208208
}
209209

210-
function escapeDollarNumber(text: string) {
211-
let escapedText = "";
212-
213-
for (let i = 0; i < text.length; i += 1) {
214-
let char = text[i];
215-
const nextChar = text[i + 1] || " ";
216-
217-
if (char === "$" && nextChar >= "0" && nextChar <= "9") {
218-
char = "\\$";
219-
}
220-
221-
escapedText += char;
222-
}
223-
224-
return escapedText;
225-
}
226-
227210
function escapeBrackets(text: string) {
228211
const pattern =
229212
/(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g;
@@ -261,7 +244,7 @@ function tryWrapHtmlCode(text: string) {
261244

262245
function _MarkDownContent(props: { content: string }) {
263246
const escapedContent = useMemo(() => {
264-
return tryWrapHtmlCode(escapeBrackets(escapeDollarNumber(props.content)));
247+
return tryWrapHtmlCode(escapeBrackets(props.content));
265248
}, [props.content]);
266249

267250
return (

0 commit comments

Comments
 (0)