1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
use crate::{helpers::safe_html_char, MathML};
use std::{
collections::BTreeMap,
fmt::{Display, Formatter},
iter::repeat,
};
mod constructors;
mod display;
#[derive(Clone, Debug, PartialEq)]
pub struct MathOperator {
operator: String,
}
#[derive(Clone, Debug, PartialEq)]
pub struct MathSpace {
attributes: BTreeMap<String, String>,
}
/// The [`<mroot>`](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mroot) or [`<msqrt>`](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msqrt) element is used to display roots with an explicit index.
#[derive(Clone, Debug, PartialEq)]
pub struct MathSqrt {
base: MathML,
surd: Option<MathML>,
}
/// The [`<mmultiscripts>`](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mmultiscripts) element is used to attach multiple subscripts and superscripts to a base.
#[derive(Clone, Debug, PartialEq)]
pub struct MathMultiScript {
base: MathML,
ru: Vec<MathML>,
rd: Vec<MathML>,
lu: Vec<MathML>,
ld: Vec<MathML>,
attributes: BTreeMap<String, String>,
}
/// The [`<munderover>`](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munderover) element is used to attach an accent or a limit under and over an expression.
#[derive(Clone, Debug, PartialEq)]
pub struct MathUnderOver {
base: MathML,
under: Option<MathML>,
over: Option<MathML>,
attributes: BTreeMap<String, String>,
}
/// The [`<mfenced>`](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced) element provides the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression.
///
/// ## Syntax
///
/// Since it is deprecated by the MathML standard, the syntax is not well defined.
#[derive(Clone, Debug, PartialEq)]
pub struct MathFenced {
base: Vec<MathML>,
open: char,
close: char,
separators: String,
}