Skip to content

Commit

Permalink
Bump version to 1.9.8 in manifest.json and update LaTeX processing lo…
Browse files Browse the repository at this point in the history
…gic in latex.js

- Updated version number in manifest.json to 1.9.8.
- Modified LaTeX processing to improve formatting, including changes to how bold text is handled and ensuring consistent rendering of mathematical expressions.
  • Loading branch information
yym68686 committed Jan 18, 2025
1 parent c40369f commit adc947c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Cerebr",
"version": "1.9.7",
"version": "1.9.8",
"description": "Cerebr - 智能AI聊天助手",
"content_security_policy": {
"extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'"
Expand Down
19 changes: 8 additions & 11 deletions src/utils/latex.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,22 @@ export function processMathAndMarkdown(text) {

text = text.replace(/:\s\*\*/g, ':**');
text = text.replace(/\*\*([^*]+?)\*\*[^\S\n]+/g, '@@$1@@#');
text = text.replace(/\*\*(?=.*[^\S\n].*\*\*)([^*]+?)\*\*(?!\s)/g, '**$1** ');
text = text.replace(/\*\*(?=.*[^\S\n].*\*\*)([^*]+?)\*\*(?!\s)/g, '#%$1%#@');
text = text.replace(/\*\*(?=.*.*\*\*)([^*]+?)\*\*(?!\s)/g, '**$1** ');
text = text.replace(/\@\@(.+?)\@\@#/g, '**$1** ');
text = text.replace(/\#\%(.+?)\%\#\@/g, '**$1** ');
text = text.replace(/ *\*\*([^\s]+?)\*\*(?!\s)/g, ' **$1** ');
// text = text.replace(/\s*\*\*([^\s]+?)\*\*(?!\s)/g, '**$1**');
// text = text.replace(/\*\*(.+?)\*\*(?!\s)/g, '**$1** ');
text = text.replace(/(\*\*.+?\*\*)\s/g, '$1:');
// console.log(text);
/*
完整复述下面的字符包括换行:
为 **Xmodel-2** 的针对**推理任务**进行
**2. 主要贡献:**
* **开源:** Xmodel-2 是开源的
**第一封邮件(7月22日)**是
即 **a** ⊗ **b** ≠ **b** ⊗ **a**。
**3. A 和 B 矩阵的生成**
* **A**:
* R
* Q
* K
**1. 主要贡献:**
**2. A 和 B 矩阵的生成**
* **开源:** Xmodel-2 是开源的
* **OLMo 2-13B**:上下文长度为 **4096 个 token**。
*/

// 处理第一级列表(确保使用3个空格)
Expand Down

0 comments on commit adc947c

Please sign in to comment.