From ffd747a092dc4b9e404687805be92ade9719f0d9 Mon Sep 17 00:00:00 2001 From: shakogegia Date: Thu, 16 Nov 2023 16:56:43 +0100 Subject: [PATCH] fix: parse element --- src/parsers/element.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parsers/element.ts b/src/parsers/element.ts index 6f6b580..b5b9838 100644 --- a/src/parsers/element.ts +++ b/src/parsers/element.ts @@ -11,8 +11,8 @@ export function element(el: Document | Element | null) { } }, children: () => el.children, - textContent: () => el.textContent, - text: () => escape(el.textContent), - textUnsafe: () => el.textContent, + textContent: () => el?.textContent, + text: () => escape(el?.textContent), + textUnsafe: () => el?.textContent, } }