bhd-components 0.10.35 → 0.10.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -199,7 +199,7 @@ const removeMermaidBlockComments = (markdownContent)=>{
199
199
  return markdownContent.replace(mermaidBlockRegex, (match, prefix, content, suffix)=>{
200
200
  // 清理块内注释的正则(同之前逻辑,优先保留字符串)
201
201
  const commentRegex = /(".*?"|'.*?')|(\/\*[\s\S]*?\*\/)|(\/\/.*?$)/gm;
202
- const cleanContent = content.replace(commentRegex, (m, stringPart)=>stringPart || '').replace(/<br>/g, '');
202
+ const cleanContent = content.replace(commentRegex, (m, stringPart)=>stringPart || '').replace(/<br>/g, '').replace(/\\n/g, '');
203
203
  // 拼接回完整代码块(保留 ```mermaid 和 ``` 标识)
204
204
  return `${prefix}${cleanContent}${suffix}`;
205
205
  });
@@ -2325,7 +2325,9 @@ const CustomerService = (props)=>{
2325
2325
  // let code = message.split("```");
2326
2326
  // code = code[1];
2327
2327
  // console.log(code,888888888);
2328
- message = removeMermaidBlockComments(message);
2328
+ if (finishedRef.current || i != historyMessageList.length - 1) {
2329
+ message = removeMermaidBlockComments(message);
2330
+ }
2329
2331
  message = handleRenderSyntaxBlock(message, finishedRef.current || i != historyMessageList.length - 1);
2330
2332
  if (lastId == item.id && keyWordProblem != "") {
2331
2333
  //点击历史记录时,找到关键字,防止关键字和标签名重复
@@ -205,7 +205,7 @@ var removeMermaidBlockComments = function(markdownContent) {
205
205
  var commentRegex = /(".*?"|'.*?')|(\/\*[\s\S]*?\*\/)|(\/\/.*?$)/gm;
206
206
  var cleanContent = content.replace(commentRegex, function(m, stringPart) {
207
207
  return stringPart || "";
208
- }).replace(/<br>/g, "");
208
+ }).replace(/<br>/g, "").replace(/\\n/g, "");
209
209
  // 拼接回完整代码块(保留 ```mermaid 和 ``` 标识)
210
210
  return "".concat(prefix).concat(cleanContent).concat(suffix);
211
211
  });
@@ -2446,7 +2446,9 @@ var CustomerService = function(props) {
2446
2446
  // let code = message.split("```");
2447
2447
  // code = code[1];
2448
2448
  // console.log(code,888888888);
2449
- message = removeMermaidBlockComments(message);
2449
+ if (finishedRef.current || i != historyMessageList.length - 1) {
2450
+ message = removeMermaidBlockComments(message);
2451
+ }
2450
2452
  message = handleRenderSyntaxBlock(message, finishedRef.current || i != historyMessageList.length - 1);
2451
2453
  if (lastId == item.id && keyWordProblem != "") {
2452
2454
  //点击历史记录时,找到关键字,防止关键字和标签名重复
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhd-components",
3
- "version": "0.10.35",
3
+ "version": "0.10.36",
4
4
  "description": "组件功能描述",
5
5
  "config": {
6
6
  "commitizen": {