Get the braille associated with the MathML that was set by [`set_mathml`]. The braille returned depends upon the preference for the `code` preference (default `Nemeth`).
(nav_node_id: String)
| 241 | /// Get the braille associated with the MathML that was set by [`set_mathml`]. |
| 242 | /// The braille returned depends upon the preference for the `code` preference (default `Nemeth`). |
| 243 | pub fn get_braille(nav_node_id: String) -> Result<String> { |
| 244 | // use std::time::{Instant}; |
| 245 | // let instant = Instant::now(); |
| 246 | return MATHML_INSTANCE.with(|package_instance| { |
| 247 | let package_instance = package_instance.borrow(); |
| 248 | let mathml = get_element(&package_instance); |
| 249 | let braille = crate::braille::braille_mathml(mathml, &nav_node_id)?; |
| 250 | // info!("Time taken: {}ms", instant.elapsed().as_millis()); |
| 251 | return Ok( braille ); |
| 252 | }); |
| 253 | } |
| 254 | |
| 255 | /// Given a key code along with the modifier keys, the current node is moved accordingly (or value reported in some cases). |
| 256 | /// `key` is the [keycode](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#constants_for_keycode_value) for the key (in JavaScript, `ev.key_code`) |