Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions src/xpath_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,24 +864,17 @@ impl IsBracketed {
return false;
}

if requires_comma {
if let ChildOfElement::Element(contents) = children[1] {
let children = contents.children();
if !is_tag(contents, "mrow") || children.len() <= 1 {
return false;
}
// finally, we can check for a comma -- we might not have operands, so we to check first and second entry
if get_text_from_COE(&children[0]).as_str() == "," {
return true;
}
if children.len() > 1 && get_text_from_COE(&children[1]).as_str() == "," {
return true;
}
}
return false;
} else {
if !requires_comma {
return true;
}
let Some(contents) = children[1].element() else {
return false;
};
let children = contents.children();
// The comma can be the first or second child when operands are absent.
return is_tag(contents, "mrow")
&& children.len() > 1
&& (get_text_from_COE(&children[0]) == "," || get_text_from_COE(&children[1]) == ",");
}
}

Expand Down
Loading