Skip to content

Support SVGs within HTML #16

@mykolaharmash

Description

@mykolaharmash

The main issue with parsing SVG is that tags inside, like path can be at the same time self-closing and have children. It's not the case with HTML where the list of self-closing tags is known upfront. Need to think of how to fit this tags duality.

SVG 2 Specs

Example of tags-duality from animationMotion tag spec. The last path has children.

<svg width="5cm" height="3cm"  viewBox="0 0 500 300"
     xmlns="http://www.w3.org/2000/svg">
  <desc>Example animMotion01 - demonstrate motion animation computations</desc>
  <rect x="1" y="1" width="498" height="298"
        fill="none" stroke="blue" stroke-width="2" />
  <path id="path1" d="M100,250 C 100,50 400,50 400,250"
        fill="none" stroke="blue" stroke-width="7.06"  />
  <circle cx="100" cy="250" r="17.64" fill="blue"  />
  <path d="M-25,-12.5 L25,-12.5 L 0,-87.5 z"
        fill="yellow" stroke="red" stroke-width="7.06"  >
    <animateMotion dur="6s" repeatCount="indefinite" rotate="auto" >
       <mpath href="#path1"/>
    </animateMotion>
  </path>
</svg>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions