String to SVG parser
An Element consists of a tag name, a list of attributes, a list of children nodes.
<svg xmlns="http://www.w3.org/2000/svg"></svg>will be parsed as
Element "svg" [ ( "xmlns", "http://www.w3.org/2000/svg" ) ] []A name/value pair to denote attribute.
Parses String to Html msg. This function filters top level comments to find the first <svg> element.
Additional <svg> elements are ignored.
Parses String to SvgNode. Normally you will use parse instead of this.
parse "<svg xmlns=\"http://www.w3.org/2000/svg\"></svg>"
== Ok (SvgElement (Element "svg" [ ( "xmlns", "http://www.w3.org/2000/svg" ) ] []))Same as parseToNode, but returns a list of all the nodes in the string.
Convert SvgNode to Svg msg. This is useful when you want to manipulate SvgNode before conveting to Html msg.
Convert SvgAttribute to Attribute msg. This is useful when you want to manipulate SvgAttribute before converting to Html msg.
This function also automatically handles the deprecated namespace attributes such as xlink:href'. See MDN Web Docs.
A SVG node can be one of the three: SvgElement, SvgText or SvgComment.