/** * @fileoverview `mathmlText` — what a MathML formula reads as once its markup is gone. A * presentation tree encodes most of its operators as structure rather than as characters: a * radical is an ``, an exponent is the second child of an ``, a fraction bar is an * ``, and a fence can live in an attribute. Emptying the tree of tags and joining its * text deletes every one of them — `√m ∈ ℚ₅` reads `m∈Q5` — so the region is read instead: * * 1. **A TeX annotation, as deposited.** A deposit that carries its expression a second time as * TeX (``) has already written the linear form, and * losslessly; it replaces the presentation tree rather than joining it, so the formula still * reaches the reader once. * 2. **Otherwise, the tree written out** in a linear notation that keeps the structure: `x_i`, * `A^{−1}`, `∑_{i=1}^N`, `^{33}Si`, `√(m)`, `√[3](x)`, `(Np)/(N−p)`, rows of a table joined * by `; `. Every other copy of the expression — a Content MathML ``, a * `` wrapper's later children — is dropped for the same reason the TeX replaces * the tree. * 3. **Any other element** is spelled `name(child, …)` over its children, so a construct with no * linear form stays visible and intact rather than reading as a different formula. * * The reading is linear in the region and costs nothing on the call stack: one tag scan builds * the tree, one pass over it in reverse document order finishes every node after its children, * and each node's text is built by concatenation rather than by copying its children's text, so * a region nested thousands of elements deep costs what a flat one does. * @module services/crossref/mathml */ /** * Read a MathML region — the content between a `` element's tags — as one line of text. * The caller supplies the block boundary the region leaves in the sentence around it. */ export declare function mathmlText(inner: string): string; //# sourceMappingURL=mathml.d.ts.map