Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

preserveResolvedObjectTags set to false preserve object tags #3

Open
noreiller opened this issue Feb 21, 2023 · 0 comments
Open

preserveResolvedObjectTags set to false preserve object tags #3

noreiller opened this issue Feb 21, 2023 · 0 comments

Comments

@noreiller
Copy link

Brief bug description

When I use the node example with the option preserveResolvedObjectTags: false, the HTML output still contains the A or OBJECT tags.

If you replace the parentNode instead of adding it to the childNodes, it works better:
https://github.com/kontent-ai/kontent-delivery-node-parser/blob/master/lib/parser/implementation/shared.ts#L155

-    element.childNodes = [rootNode];
+    Object.entries(rootNode).forEach(([attributeName, attributeValue]) => {
+        element[attributeName] = attributeValue
+    })

Expected behavior

No duplicated tags.

Test environment

  • Node

Additional context

Add any other context about the problem here.

Screenshots

Add links to screenshots, if possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant