tkserver 1.7.19 → 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 (3) hide show
  1. package/index.js +3 -3
  2. package/mongo.js +3 -3
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -12,7 +12,7 @@ const getUserIP = require('get-user-ip')
12
12
  const Lfsa = require('lokijs/src/loki-fs-structured-adapter')
13
13
  const { v4: uuidv4 } = require('uuid') // 用户 id 生成
14
14
  const {
15
- getCheerio,
15
+ getHtmlToText,
16
16
  getDomPurify,
17
17
  getMd5,
18
18
  getSha256,
@@ -63,7 +63,7 @@ const { sendNotice, emailTest } = require('twikoo-func/utils/notify')
63
63
  const { uploadImage } = require('twikoo-func/utils/image')
64
64
  const logger = require('twikoo-func/utils/logger')
65
65
 
66
- const $ = getCheerio()
66
+ const htmlToText = getHtmlToText()
67
67
  const DOMPurify = getDomPurify()
68
68
  const md5 = getMd5()
69
69
  const sha256 = getSha256()
@@ -1039,7 +1039,7 @@ async function getRecentComments (event) {
1039
1039
  mailMd5: getMailMd5(comment),
1040
1040
  link: comment.link,
1041
1041
  comment: comment.comment,
1042
- commentText: $(comment.comment).text(),
1042
+ commentText: htmlToText(comment.comment),
1043
1043
  created: comment.created
1044
1044
  }
1045
1045
  })
package/mongo.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
  getDomPurify,
15
15
  getMd5,
16
16
  getSha256,
@@ -59,7 +59,7 @@ const { sendNotice, emailTest } = require('twikoo-func/utils/notify')
59
59
  const { uploadImage } = require('twikoo-func/utils/image')
60
60
  const logger = require('twikoo-func/utils/logger')
61
61
 
62
- const $ = getCheerio()
62
+ const htmlToText = getHtmlToText()
63
63
  const DOMPurify = getDomPurify()
64
64
  const md5 = getMd5()
65
65
  const sha256 = getSha256()
@@ -1026,7 +1026,7 @@ async function getRecentComments (event) {
1026
1026
  mailMd5: getMailMd5(comment),
1027
1027
  link: comment.link,
1028
1028
  comment: comment.comment,
1029
- commentText: $(comment.comment).text(),
1029
+ commentText: htmlToText(comment.comment),
1030
1030
  created: comment.created
1031
1031
  }
1032
1032
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tkserver",
3
- "version": "1.7.19",
3
+ "version": "1.7.20",
4
4
  "description": "A simple comment system.",
5
5
  "keywords": [
6
6
  "twikoo",
@@ -31,7 +31,7 @@
31
31
  "get-user-ip": "^1.0.1",
32
32
  "lokijs": "^1.5.12",
33
33
  "mongodb": "^6.3.0",
34
- "twikoo-func": "1.7.19",
34
+ "twikoo-func": "1.7.20",
35
35
  "uuid": "^8.3.2"
36
36
  }
37
37
  }