2021-12-22 04:28:20 -07:00
|
|
|
import type { HTMLElement, Options } from 'node-html-parser';
|
|
|
|
import _parse from 'node-html-parser';
|
2021-03-01 07:21:04 -07:00
|
|
|
|
2021-12-22 04:28:20 -07:00
|
|
|
export type { HTMLElement, Options };
|
2020-09-08 04:26:17 -06:00
|
|
|
|
2021-10-01 02:39:29 -06:00
|
|
|
export function parse(html: string, config?: Partial<Options>): HTMLElement {
|
|
|
|
if (typeof config !== 'undefined') {
|
|
|
|
return _parse(html, config);
|
|
|
|
}
|
|
|
|
|
2021-03-01 07:21:04 -07:00
|
|
|
return _parse(html);
|
2020-09-08 04:26:17 -06:00
|
|
|
}
|