mbylstra / html-to-elm

An online tool for converting HTML to elm-html. Go to
http://mbylstra.github.io/html-to-elm/
394 stars 23 forks source link

added [defs, clipPath, path, g, d, fill, viewBox] Svg nodes and attributes #11

Closed pdamoc closed 8 years ago

pdamoc commented 8 years ago

These are among the most frequently used.

mbylstra commented 8 years ago

Great, thanks for this! I'll deploy it gh-pages.

mbylstra commented 8 years ago

That's been published. Here's a little test you can paste in to see it working:

<svg viewBox="1,2,3,4" >
  <g>
    <defs>
    </defs>
    <path d="somenumbersandletters" fill="red">
    </path>
    <clipPath fill="red">
    </clipPath>
  </g>
</svg>

I realise that is nonsensical SVG, but you can see that it is parsing those tags and attributes.

pdamoc commented 8 years ago

Hi Michael, I know that it works as I've tested it with a more complex SVG in my fork before creating the the PR. :)

Now, the main challenge is around attributes that clash with nodes as it is the case for clipPath and with attributes that solve to a non-obvious name as it is the case with xmlns -> xmlSpace

mbylstra commented 8 years ago

Let's move this conversation to the open SVG issue. I hope you don't mind me referencing your comment.