natefaubion / purescript-spork

Elm-like for PureScript
MIT License
157 stars 9 forks source link

SVG support #18

Closed alpacaaa closed 6 years ago

alpacaaa commented 6 years ago

Is there a way to use SVG out of the box? I've had some success copy pasting some code from this issue but I don't understand enough about what's going on to submit a PR.

Thanks!

natefaubion commented 6 years ago

I think the only thing that is required is that SVG elements need the appropriate namespace. https://github.com/natefaubion/purescript-spork/blob/master/src/Spork/Html/Core.purs#L138 The default elem creates an ElemSpec with no namespace (Nothing). For SVG we should create one with Just (Namespace "http://www.w3.org/2000/svg").

alpacaaa commented 6 years ago

Yep, that does it. Would you accept a PR that adds a elemWithNS function?

natefaubion commented 6 years ago

Yes, and a matching one for keyed.