Skip to content

Commit

Permalink
refactor parseFromString to parseHTMLUnsafe (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored Oct 29, 2024
1 parent 349ceb0 commit f8b6698
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
offset = offset += page;

const html = await fetch(`/api/fragment?offset=${offset}&limit=10`).then(resp => resp.text());
const fragment = new DOMParser().parseFromString(html, 'text/html', {
const fragment = Document.parseHTMLUnsafe(html, 'text/html', {
includeShadowRoots: true
});

Expand Down
2 changes: 1 addition & 1 deletion src/pages/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'content-type': 'application/x-www-form-urlencoded'
})
}).then(resp => resp.text());
const fragment = new DOMParser().parseFromString(html, 'text/html', {
const fragment = Document.parseHTMLUnsafe(html, 'text/html', {
includeShadowRoots: true
});

Expand Down

0 comments on commit f8b6698

Please sign in to comment.