Skip to content

Commit

Permalink
Improve MXML name string
Browse files Browse the repository at this point in the history
  • Loading branch information
hydroper committed May 2, 2024
1 parent 2deb0f6 commit e0049a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/parser/tree/mxml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ impl MxmlName {
}

pub fn to_string(&self, namespace: &Rc<MxmlNamespace>) -> String {
self.resolve_name(namespace).map(|(uri, localname)| format!("{uri}:{localname}")).unwrap_or("[error]".into())
self.resolve_name(namespace).map(|(uri, localname)| {
if uri.is_empty() {
return localname;
}
format!("{uri}:{localname}")
}).unwrap_or("[error]".into())
}
}

Expand Down

0 comments on commit e0049a9

Please sign in to comment.