mirror of
https://github.com/svg/svgo.git
synced 2025-08-09 02:22:08 +03:00
Convert cdata and text nodes to xast
Ref https://github.com/syntax-tree/xast More consistent naming and distinction by type looks a bit cleaner.
This commit is contained in:
@@ -154,8 +154,9 @@ const computeStyle = (node) => {
|
||||
) {
|
||||
const children = styleNode.content || [];
|
||||
for (const child of children) {
|
||||
const css = child.text || child.cdata;
|
||||
stylesheet.push(...parseStylesheet(css, dynamic));
|
||||
if (child.type === 'text' || child.type === 'cdata') {
|
||||
stylesheet.push(...parseStylesheet(child.value, dynamic));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user