(&self, mathml: Element<'a>)
| 168 | } |
| 169 | |
| 170 | pub fn get_navigation_mathml<'a>(&self, mathml: Element<'a>) -> Result<(Element<'a>, usize)> { |
| 171 | if self.position_stack.is_empty() { |
| 172 | return Ok( (mathml, 0) ); |
| 173 | } else { |
| 174 | let (position, _) = self.top().unwrap(); |
| 175 | return match get_node_by_id(mathml, &position.current_node) { |
| 176 | None => bail!("internal error: id '{}' was not found in mathml:\n{}", |
| 177 | position.current_node, mml_to_string(&mathml)), |
| 178 | Some(found) => Ok( (found, position.current_node_offset) ) |
| 179 | }; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | pub fn get_navigation_mathml_id(&self, mathml: Element) -> (String, usize) { |
| 184 | if self.position_stack.is_empty() { |
no test coverage detected