diff --git a/.dockerignore b/.dockerignore index 3c3629e64..761b70838 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,100 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Node.js dependencies +/node_modules +/jspm_packages + +# TypeScript v1 declaration files +typings + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.test + +# local env files +.env*.local + +# Next.js build output +.next +out + +# Nuxt.js build output +.nuxt +dist + +# Gatsby files +.cache/ +public + +# Vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# Temporary folders +tmp +temp + +# IDE and editor directories +.idea +.vscode +*.swp +*.swo +*~ + +# OS generated files +.DS_Store +Thumbs.db + +# secret key +*.key +*.key.pub + +# node node_modules diff --git a/README.md b/README.md index 0398a9bfe..429a02d63 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ If you do not want users to use GPT-4, set this value to 1. > Default: Empty -If you do want users to query balance, set this value to 1, or you should set it to 0. +If you do want users to query balance, set this value to 1. ### `DISABLE_FAST_LINK` (optional) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 1445e4fdd..36de1b229 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -116,9 +116,27 @@ function escapeDollarNumber(text: string) { return escapedText; } +function escapeBrackets(text: string) { + const pattern = + /(```[\s\S]*?```|`.*?`)|\\\[([\s\S]*?[^\\])\\\]|\\\((.*?)\\\)/g; + return text.replace( + pattern, + (match, codeBlock, squareBracket, roundBracket) => { + if (codeBlock) { + return codeBlock; + } else if (squareBracket) { + return `$$${squareBracket}$$`; + } else if (roundBracket) { + return `$${roundBracket}$`; + } + return match; + }, + ); +} + function _MarkDownContent(props: { content: string }) { const escapedContent = useMemo( - () => escapeDollarNumber(props.content), + () => escapeBrackets(escapeDollarNumber(props.content)), [props.content], ); diff --git a/package.json b/package.json index 36135c250..a9eee166d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "bcryptjs": "^2.4.3", "cron": "^3.1.6", "echarts": "^5.4.3", - "emoji-picker-react": "^4.7.10", + "emoji-picker-react": "^4.9.2", "fuse.js": "^7.0.0", "html-to-image": "^1.11.11", "mermaid": "^10.7.0", @@ -56,12 +56,12 @@ "zustand": "^4.5.0" }, "devDependencies": { - "@tauri-apps/cli": "^1.5.8", + "@tauri-apps/cli": "1.5.11", + "@types/node": "^20.11.30", + "@types/react": "^18.2.70", "@types/bcryptjs": "^2.4.6", "@types/cookie": "^0.6.0", - "@types/node": "^20.11.10", "@types/nodemailer": "^6.4.14", - "@types/react": "^18.2.48", "@types/react-dom": "^18.2.7", "@types/react-highlight-words": "^0.16.7", "@types/react-katex": "^3.0.0", diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 000000000..e69de29bb