fix(nextjs): extracts html elements inside of svg to solve pptx export issue

This commit is contained in:
sauravniraula 2025-07-29 14:26:13 +05:45
parent f28e25fb0c
commit 46552b29e0
No known key found for this signature in database
GPG key ID: 60FCC1B5A5E83326
3 changed files with 3 additions and 4 deletions

View file

@ -232,7 +232,7 @@ async function getAllChildElementsAttributes({ element, rootRect = null, depth =
for (const childElementHandle of directChildElementHandles) {
const attributes = await getElementAttributes(childElementHandle);
if (attributes.tagName === "style") {
if (['style', 'script', 'link', 'meta', 'path'].includes(attributes.tagName)) {
continue;
}
@ -268,8 +268,8 @@ async function getAllChildElementsAttributes({ element, rootRect = null, depth =
allResults.push({ attributes, depth });
//? If the element is a svg, canvas, or table, we don't need to go deeper
if (attributes.should_screenshot) {
//? If the element is a canvas, or table, we don't need to go deeper
if (attributes.should_screenshot && attributes.tagName !== 'svg') {
continue;
}

View file

@ -37,7 +37,6 @@
"@tiptap/extension-underline": "^2.0.0",
"@tiptap/react": "^2.11.5",
"@tiptap/starter-kit": "^2.11.5",
"@types/sharp": "^0.32.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "^1.0.0",