Skip to content

Commit

Permalink
🐛 fix: Fix eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jul 1, 2024
1 parent cae5e74 commit 34ade8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"devDependencies": {
"@ant-design/icons": "^5.3.7",
"@commitlint/cli": "^19.3.0",
"@lobehub/lint": "^1.24.2",
"@lobehub/lint": "^1.24.3",
"@testing-library/react": "^14.3.1",
"@types/chroma-js": "^2.4.4",
"@types/lodash-es": "^4.17.12",
Expand Down
6 changes: 2 additions & 4 deletions src/Markdown/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function escapeDollarNumber(text: string) {
const nextChar = text[i + 1] || ' ';

if (char === '$' && nextChar >= '0' && nextChar <= '9') {
char = String.raw`\$`;
char = '\\$';
}

escapedText += char;
Expand All @@ -30,7 +30,5 @@ export function escapeBrackets(text: string) {
}

export function escapeMhchem(text: string) {
return text
.replaceAll(String.raw`$\ce{`, String.raw`$\\ce{`)
.replaceAll(String.raw`$\pu{`, String.raw`$\\pu{`);
return text.replaceAll('$\\ce{', '$\\\\ce{').replaceAll('$\\pu{', '$\\\\pu{');
}

0 comments on commit 34ade8d

Please sign in to comment.