mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-14 14:07:38 -07:00
Module 'parse5' as import syntax (#4015)
This commit is contained in:
parent
ef7441ed0c
commit
c7afe7a3de
2 changed files with 3 additions and 2 deletions
|
@ -67,6 +67,7 @@
|
||||||
"@types/nodemailer": "4.6.5",
|
"@types/nodemailer": "4.6.5",
|
||||||
"@types/nprogress": "0.0.29",
|
"@types/nprogress": "0.0.29",
|
||||||
"@types/oauth": "0.9.1",
|
"@types/oauth": "0.9.1",
|
||||||
|
"@types/parse5": "5.0.0",
|
||||||
"@types/parsimmon": "1.10.0",
|
"@types/parsimmon": "1.10.0",
|
||||||
"@types/portscanner": "2.1.0",
|
"@types/portscanner": "2.1.0",
|
||||||
"@types/pug": "2.0.4",
|
"@types/pug": "2.0.4",
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
const parse5 = require('parse5');
|
import { parseFragment, DefaultTreeDocumentFragment } from 'parse5';
|
||||||
import { URL } from 'url';
|
import { URL } from 'url';
|
||||||
|
|
||||||
export function fromHtml(html: string): string {
|
export function fromHtml(html: string): string {
|
||||||
if (html == null) return null;
|
if (html == null) return null;
|
||||||
|
|
||||||
const dom = parse5.parseFragment(html);
|
const dom = parseFragment(html) as DefaultTreeDocumentFragment;
|
||||||
|
|
||||||
let text = '';
|
let text = '';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue