aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/utils.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2023-09-02 21:23:53 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2023-09-02 21:23:53 +0200
commit8fa0873a632f828ed1ad85aa30dee97bc585d32f (patch)
treeadf24490470a8863ca86dafb7d127c4e63148837 /src/utils/utils.js
parentb30f0d691dfec74bc855e5550970d0fb35931881 (diff)
downloadsvg.js-8fa0873a632f828ed1ad85aa30dee97bc585d32f.tar.gz
svg.js-8fa0873a632f828ed1ad85aa30dee97bc585d32f.zip
skip descriptive elements on rebuild and toParent
Diffstat (limited to 'src/utils/utils.js')
-rw-r--r--src/utils/utils.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/utils.js b/src/utils/utils.js
index c6e6d3b..0d297ec 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -120,3 +120,7 @@ export function getOrigin(o, element) {
// Return the origin as it is if it wasn't a string
return [ox, oy]
}
+
+const descriptiveElements = new Set(['desc', 'metadata', 'title'])
+export const isDescriptive = (element) =>
+ descriptiveElements.has(element.nodeName)