twikoo-vercel 1.7.18 → 1.7.20

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.
Files changed (2) hide show
  1. package/api/index.js +3 -3
  2. package/package.json +2 -2
package/api/index.js CHANGED
@@ -10,7 +10,7 @@ const getUserIP = require('get-user-ip')
10
10
  const { URL } = require('url')
11
11
  const { v4: uuidv4 } = require('uuid') // 用户 id 生成
12
12
  const {
13
- getCheerio,
13
+ getHtmlToText,
14
14
  getAxios,
15
15
  getDomPurify,
16
16
  getMd5,
@@ -62,7 +62,7 @@ const { sendNotice, emailTest } = require('twikoo-func/utils/notify')
62
62
  const { uploadImage } = require('twikoo-func/utils/image')
63
63
  const logger = require('twikoo-func/utils/logger')
64
64
 
65
- const $ = getCheerio()
65
+ const htmlToText = getHtmlToText()
66
66
  const axios = getAxios()
67
67
  const DOMPurify = getDomPurify()
68
68
  const md5 = getMd5()
@@ -1045,7 +1045,7 @@ async function getRecentComments (event) {
1045
1045
  mailMd5: getMailMd5(comment),
1046
1046
  link: comment.link,
1047
1047
  comment: comment.comment,
1048
- commentText: $(comment.comment).text(),
1048
+ commentText: htmlToText(comment.comment),
1049
1049
  created: comment.created
1050
1050
  }
1051
1051
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twikoo-vercel",
3
- "version": "1.7.18",
3
+ "version": "1.7.20",
4
4
  "description": "A simple comment system.",
5
5
  "author": "imaegoo <hello@imaegoo.com> (https://github.com/imaegoo)",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "get-user-ip": "^1.0.1",
15
15
  "mongodb": "^6.3.0",
16
- "twikoo-func": "1.7.18",
16
+ "twikoo-func": "1.7.20",
17
17
  "uuid": "^8.3.2"
18
18
  }
19
19
  }