Skip to content

Commit

Permalink
refactor parseFromString to parseHTMLUnsafe (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
thescientist13 authored Oct 29, 2024
1 parent 8e30761 commit dc4c6a6
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 @@ -24,7 +24,7 @@
globalThis.document.getElementById('load-products').addEventListener('click', async () => {
offset = offset += page;
const html = await fetch(`/api/fragment?offset=${offset}`).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 dc4c6a6

Please sign in to comment.