Skip to content

Commit 678c297

Browse files
committed
[Bug leo-buneev#41] Update html-to-text to fix parsing
1 parent 5621b5e commit 678c297

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { path } = require('@vuepress/shared-utils')
2-
const htmlToText = require('html-to-text')
2+
const { htmlToText } = require('html-to-text')
33
const _ = require('lodash')
44

55
let customTitles = null
@@ -10,7 +10,7 @@ module.exports = (options, ctx, globalCtx) => ({
1010
const { html } = $page._context.markdown.render($page._strippedContent || '')
1111
if (!customTitles) customTitles = getCustomTitles(globalCtx)
1212

13-
const plaintext = htmlToText.fromString(html, {
13+
const plaintext = htmlToText(html, {
1414
wordwrap: null,
1515
hideLinkHrefIfSameAsText: true,
1616
ignoreImage: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"flexsearch": "^0.6.32",
14-
"html-to-text": "^5.1.1",
14+
"html-to-text": "^7.0.0",
1515
"lodash": "^4.17.19",
1616
"vuepress": "^1.4.0"
1717
},

0 commit comments

Comments
 (0)