File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/yew/src/dom_bundle/btag Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -238,8 +238,18 @@ impl Reconcilable for VTag {
238238impl VTag {
239239 fn create_element ( & self , parent : & Element ) -> Element {
240240 let tag = self . tag ( ) ;
241-
242- if tag == "svg" || parent. namespace_uri ( ) . is_some_and ( |ns| ns == SVG_NAMESPACE ) {
241+ // check for an xmlns attribute. If it exists, create an element with the specified
242+ // namespace
243+ if let Some ( xmlns) = self
244+ . attributes
245+ . iter ( )
246+ . find ( |( k, _) | * k == "xmlns" )
247+ . map ( |( _, v) | v)
248+ {
249+ document ( )
250+ . create_element_ns ( Some ( xmlns) , tag)
251+ . expect ( "can't create namespaced element for vtag" )
252+ } else if tag == "svg" || parent. namespace_uri ( ) . is_some_and ( |ns| ns == SVG_NAMESPACE ) {
243253 let namespace = Some ( SVG_NAMESPACE ) ;
244254 document ( )
245255 . create_element_ns ( namespace, tag)
You can’t perform that action at this time.
0 commit comments