Skip to content

parseAttributes

parseAttributes(element, attributes, cssRules?): Record<string, any>

Defined in: src/parser/parseAttributes.ts:19

Returns an object of attributes’ name/value, given element and an array of attribute names; Parses parent “g” nodes recursively upwards.

Parameters

element

Element to parse

null | HTMLElement

attributes

string[]

Array of attributes to parse

cssRules?

CSSRules

Returns

Record<string, any>

object containing parsed attributes’ names/values