lynaghk / singult

JavaScript Hiccup compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<img> tags incorrectly render as SVG elements

bobby opened this issue · comments

It appears that the re_svg_tags regexp is incorrectly matching img tags, probably due to its matching unanchored SVG g tags. It may be that adding start/end anchors to the regexp will work, i.e.:

re_svg_tags = /^(svg|g|rect|circle|clipPath|path|line|polygon|polyline|text|textPath)$/

instead of

re_svg_tags = /(svg|g|rect|circle|clipPath|path|line|polygon|polyline|text|textPath)/

but I haven't tested it yet. I'll submit a patch or pull request if I get the chance.

Oh damn, how embarrassing. I guess we're so into data driven graphics over here that we haven't used an <img> tag yet =/

I'm on the road right now, so I won't have time to test.
If you can verify and submit a pull, I'd be happy to accept it.

thanks.

Fixed in 93eeb80.