Knio / dominate

Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. It allows you to write HTML pages in pure Python very concisely, which eliminate the need to learn another template language, and to take advantage of the more powerful features of Python.
GNU Lesser General Public License v3.0
1.72k stars 108 forks source link

I'd like to add support for SVG #114

Closed washad closed 5 years ago

washad commented 5 years ago

If OK, I'd like to add support for SVG tags. There are a lot of tags, so I figured it better to submit a sample first. If you approve, I will subsequently add the remaining tags and tests for each.

Regards, Steve J

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.1%) to 96.956% when pulling f73b7633cb948536902400c59455b5a6e65451af on washad:master into 0d26dcb5293933deec3c3d58cf9e8ea274b14f68 on Knio:master.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.5%) to 97.375% when pulling d108c16d6059d619523df6b38947a03cc63b711a on washad:master into 0d26dcb5293933deec3c3d58cf9e8ea274b14f68 on Knio:master.

Knio commented 5 years ago

Seems good. I left a couple review comments. I am not sure if more work will need to be done for supporting svg namespaces nicely in the output.

washad commented 5 years ago

Should be at a point where you can look at it. One note, I added some support for converting underscore to dashed - it seems to be required in several instances for SVG. Not sure if the way I did it is the best, but my goal was not to touch your code. Feel free to re-write it or recommend changes.

washad commented 5 years ago

Sorry for so many commits - I'm not used to this backward compatibility thing so I'm figuring it out as I go along. Looks like I have all tests passing now.

Do you still use this pull request or do I close it and do a new one?

Knio commented 5 years ago

Thanks! You can leave this PR open and I will review/merge it from here. I probably won't have time to look at it all until at least the weekend though.

washad commented 5 years ago

Think you will have a chance to look at this soon? I'd like to use the changes in a project I'm working on.

Knio commented 5 years ago

I just squash/rebased and cleaned a few things up, and merged this to master. It's also been pushed to PyPI with version 2.4.0 ready to use.

Thanks for the PR!