fix: html factory grab object children ex. svg
This commit is contained in:
parent
8fc7738f20
commit
75ad1043d0
@ -7,6 +7,7 @@
|
||||
"scripts": {
|
||||
"dev": "parcel watch src/manifest.json --host localhost --target pinmenote-dev --no-cache",
|
||||
"dev:ff": "parcel build src/manifest.json --target pinmenote-firefox-dev --no-cache --detailed-report 0",
|
||||
"build": "npm run prod && npm run prod:ff",
|
||||
"prod": "parcel build src/manifest.json --target pinmenote-prod --no-cache --detailed-report 0",
|
||||
"prod:ff": "parcel build src/manifest.json --target pinmenote-firefox-prod --no-cache --detailed-report 0",
|
||||
"lint": "eslint --ext .ts,.tsx src/",
|
||||
|
@ -167,6 +167,18 @@ export class HtmlFactory {
|
||||
fnConsoleLog('PROBLEM fnComputeHtmlContent !!!', node.nodeType);
|
||||
}
|
||||
}
|
||||
|
||||
// Fix object element children
|
||||
if (ref instanceof HTMLObjectElement && ref.contentDocument) {
|
||||
const children = Array.from(ref.contentDocument.childNodes);
|
||||
for (const node of children) {
|
||||
if (node.nodeType === Node.ELEMENT_NODE) {
|
||||
const computed = await this.computeHtmlIntermediateData(node as Element);
|
||||
html += computed.html;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
html += `</${tagName}>`;
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user