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

Function get_navigation_mathml

src/interface.rs:315–326  ·  view source on GitHub ↗

Return the MathML associated with the current (navigation) node. The returned result is the `id` of the node and the offset (0-based) from that node (not yet implemented) The offset is needed for token elements that have multiple characters.

()

Source from the content-addressed store, hash-verified

313/// The returned result is the `id` of the node and the offset (0-based) from that node (not yet implemented)
314/// The offset is needed for token elements that have multiple characters.
315pub fn get_navigation_mathml() -> Result<(String, usize)> {
316 return MATHML_INSTANCE.with(|package_instance| {
317 let package_instance = package_instance.borrow();
318 let mathml = get_element(&package_instance);
319 return NAVIGATION_STATE.with(|nav_stack| {
320 return match nav_stack.borrow_mut().get_navigation_mathml(mathml) {
321 Err(e) => Err(e),
322 Ok( (found, offset) ) => Ok( (mml_to_string(&found), offset) ),
323 }
324 } )
325 });
326}
327
328/// Return the `id` and `offset` (0-based) associated with the current (navigation) node.
329/// `offset` (not yet implemented)

Callers

nothing calls this directly

Calls 3

get_elementFunction · 0.85
mml_to_stringFunction · 0.85
get_navigation_mathmlMethod · 0.80

Tested by

no test coverage detected