Closed ivanceras closed 5 years ago
Thanks so much for opening this clean up PR!
I’m a bit hesitant on adding a dependency to html-macro for something like this.
On the bright side the code deduplication is lovely
But on the other side I think that it’s fine to duplicate the whitelist since it really shouldn’t change often since new self closing tags don’t get added to the html spec very often.
So my thinking here is that we should just keep the duplication and avoid the extra dependency.
Curious if you see this differently?
Thanks again !!
Hi, I am trying to add support for inline svg. Though the HTML spec specifies that document.createElement
creates an html object, it doesn't work for svg
and it's sub elements such as circle
, rect
etc. Most of the svg
sub elements are self closing tags. There is no way for the html-macro
parser to determine if svg
element tags should have a namespace and be created with document.createElementNS
. So an explicit list of which tags belongs to which namespace will be necessary and will be instantiated accordingly.
Gotcha!
This works for now then - but we might want to move it into a crates/html-validation crate and have both share that dependency (which we can add more validation to over time)
This change is![Reviewable](https://reviewable.io/review_button.svg)