From 73415a4a0d97a8030d23fabbdc0de059748e2a5a Mon Sep 17 00:00:00 2001 From: William Moore Date: Wed, 14 Jun 2023 03:53:56 -0500 Subject: [PATCH] Update to fix some RSS issues with hugo --- src/RSS.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RSS.ts b/src/RSS.ts index 5fc4f83..eae5622 100644 --- a/src/RSS.ts +++ b/src/RSS.ts @@ -39,8 +39,9 @@ export class RSS extends LitElement { const allItems: RSSItem[] = []; const response = await fetch(url, options); const result = await response.text(); - const rss = (new DOMParser()).parseFromString(result, 'text/xml'); + const rss = (new DOMParser()).parseFromString(result.trim(), 'text/xml'); const channel = rss.getElementsByTagName('channel')[0] ?? null; + console.log(rss); for (let channelI = 0; channelI < channel?.children?.length; channelI++) { const channelChild = channel?.children?.item(channelI); @@ -77,7 +78,6 @@ export class RSS extends LitElement { console.error(error); } - // setTimeout(() => this.pullValueFromBackend(), 1000); } static override styles = [