hotfix: fix build error
This commit is contained in:
parent
edfa0c65f9
commit
9b5842b20e
2 changed files with 23 additions and 21 deletions
|
|
@ -1,6 +1,6 @@
|
|||
const parser = new DOMParser();
|
||||
const parser = typeof DOMParser !== 'undefined' ? new DOMParser() : null;
|
||||
export let html = (string) => {
|
||||
return parser.parseFromString(string, 'text/html').querySelectorAll('*');
|
||||
return parser?.parseFromString(string, 'text/html').querySelectorAll('*');
|
||||
};
|
||||
let parseChunk = (chunk) => {
|
||||
if (Array.isArray(chunk)) return chunk.flat().join('');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue