Skip to content

Commit

Permalink
Module 'parse5' as import syntax (#4015)
Browse files Browse the repository at this point in the history
  • Loading branch information
acid-chicken authored and AyaMorisawa committed Feb 1, 2019
1 parent 341838b commit 723d5ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@types/nodemailer": "4.6.5",
"@types/nprogress": "0.0.29",
"@types/oauth": "0.9.1",
"@types/parse5": "5.0.0",
"@types/parsimmon": "1.10.0",
"@types/portscanner": "2.1.0",
"@types/pug": "2.0.4",
Expand Down
4 changes: 2 additions & 2 deletions src/mfm/fromHtml.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const parse5 = require('parse5');
import { parseFragment, DefaultTreeDocumentFragment } from 'parse5';
import { URL } from 'url';

export function fromHtml(html: string): string {
if (html == null) return null;

const dom = parse5.parseFragment(html);
const dom = parseFragment(html) as DefaultTreeDocumentFragment;

let text = '';

Expand Down

0 comments on commit 723d5ba

Please sign in to comment.