MCPcopy Create free account
hub / github.com/daisy/MathCAT / get_navigation_mathml

Method get_navigation_mathml

src/navigate.rs:170–181  ·  view source on GitHub ↗
(&self, mathml: Element<'a>)

Source from the content-addressed store, hash-verified

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() {

Callers 1

get_navigation_mathmlFunction · 0.80

Calls 3

get_node_by_idFunction · 0.85
is_emptyMethod · 0.80
topMethod · 0.80

Tested by

no test coverage detected