@celhive/tool.js 0.0.2 → 0.0.4

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.
package/README.md CHANGED
@@ -1,7 +1,5 @@
1
- # @herm-studio/tool.js
2
-
3
1
  ## Install
4
2
 
5
3
  ```shell
6
- npm install @herm-studio/tool.js
4
+ npm install @celhive/tool.js
7
5
  ```
@@ -35,8 +35,12 @@ const mendMarkdown = (md) => {
35
35
  .join('\n');
36
36
  const mendedTitle = mendTitle.trim();
37
37
  const mendBold = mendedTitle.replace(/\*\*(.*?)\*\*/g, (match, p1) => {
38
- return p1.includes('(') && p1.includes(')') ? `<b>${p1}</b>` : match;
38
+ return (p1.includes('(') && p1.includes(')')) || p1.includes(':')
39
+ ? `<b>${p1}</b>`
40
+ : match;
39
41
  });
40
- return mendBold;
42
+ // 写一个正则,如果 ```mermaid 前面只有一个换行符,就添加一个换行符
43
+ const result = mendBold.replace(/(\n)```mermaid/g, '$1\n```mermaid');
44
+ return result;
41
45
  };
42
46
  exports.mendMarkdown = mendMarkdown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celhive/tool.js",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"