Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been playing around with yew a bit and am enjoying it so far, but I really wanted SVG support. This is a working POC I'm toying with at the moment. I wanted to put this up for discussion as there are others interested in yew correctly rendering SVGs: #328, #143.
It is implemented as a sort of final pass after packing the virtual DOM stack generated during html macro execution. The solution I applied is to intercept specific tag names (namely svg) and add a namespace to their VTag. Then, at the conclusion of processing the html macro, the configured namespaces are proliferated down the children graph (unless explicitly overridden by a deeper explicit namespace being configured - which isn't currently possible). Finally, when apply is called, if the VTag has a namespace then create_element_ns will be called instead of create_element. Note that this change is contingent on koute/stdweb#271 or something like it being accepted.
Anywho, points for discussion:
I also tidied up the grammar/formatting a bit in areas I touched. If that is an issue, those changes can be reverted.