Skip to content

Commit

Permalink
fix(html): recursively update ns_qualifiers when resolving a reference (
Browse files Browse the repository at this point in the history
  • Loading branch information
crowlKats authored Dec 16, 2024
1 parent fbc0b77 commit 0de7406
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,24 @@ impl GenerateCtx {
parent.ns_qualifiers.len() + node.ns_qualifiers.len(),
);
ns_qualifiers.extend(parent.sub_qualifier());
ns_qualifiers.extend(node.ns_qualifiers.iter().cloned());
node.ns_qualifiers = ns_qualifiers.into();

fn handle_node(
node: &mut DocNodeWithContext,
ns_qualifiers: Vec<String>,
) {
if let Some(children) = &mut node.namespace_children {
for node in children {
handle_node(node, ns_qualifiers.clone());
}
}

let mut new_ns_qualifiers = ns_qualifiers;
new_ns_qualifiers.extend(node.ns_qualifiers.iter().cloned());
node.ns_qualifiers = new_ns_qualifiers.into();
}

handle_node(&mut node, ns_qualifiers);

Cow::Owned(node)
} else {
node
Expand Down

0 comments on commit 0de7406

Please sign in to comment.