We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4398e43 commit c45fa0cCopy full SHA for c45fa0c
1 file changed
cli.ts
@@ -10,11 +10,12 @@ function htmlToText(html: string): string {
10
.replace(/<\/div>/gi, "\n")
11
.replace(/<\/li>/gi, "\n")
12
.replace(/<[^>]+>/g, "")
13
+ .replace(/&#(\d+);/g, (_m, code) => String.fromCodePoint(Number(code)))
14
+ .replace(/&#x([0-9a-fA-F]+);/g, (_m, code) => String.fromCodePoint(parseInt(code, 16)))
15
.replace(/&/g, "&")
16
.replace(/</g, "<")
17
.replace(/>/g, ">")
18
.replace(/"/g, '"')
- .replace(/'/g, "'")
19
.replace(/ /g, " ")
20
.replace(/\n{3,}/g, "\n\n")
21
.trim();
0 commit comments