]> git.lyx.org Git - features.git/commitdiff
MathML: stop stretching all delimiters.
authorThibaut Cuvelier <tcuvelier@lyx.org>
Mon, 11 Mar 2024 00:40:16 +0000 (01:40 +0100)
committerThibaut Cuvelier <tcuvelier@lyx.org>
Mon, 11 Mar 2024 00:40:16 +0000 (01:40 +0100)
No form? Reference: https://w3c.github.io/mathml-core/#dfn-form. The MathML processor is smart enough to determine whether the delimiter is prefix or postfix.

No stretchy/symmetric/fence in all cases? Reference: https://w3c.github.io/mathml-core/#algorithm-for-determining-the-properties-of-an-embellished-operator and https://w3c.github.io/mathml-core/#operator-dictionary-human (example entry: U+0028). Delimiters have the right properties by default.

src/mathed/InsetMathDelim.cpp

index d32029b818e303f32894adf1a7ceb1d04e363b24..fab72db88d92ac05967aa4ff8ac45b2f9c62416f 100644 (file)
@@ -190,15 +190,16 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const
 void InsetMathDelim::mathmlize(MathMLStream & ms) const
 {
        // Ignore the delimiter if: it is empty or only a space (one character).
+       const std::string attr = is_extracted_ ? "stretchy='false'" : "";
        if (!left_.empty() && ((left_.size() == 1 && left_[0] != ' ') || left_.size() > 1)) {
            ms << MTag("mrow")
-              << MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'")
+              << MTagInline("mo", attr)
               << convertDelimToXMLEscape(left_)
               << ETagInline("mo");
        }
        ms << cell(0);
        if (!right_.empty() && ((right_.size() == 1 && right_[0] != ' ') || right_.size() > 1)) {
-           ms << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'")
+           ms << MTagInline("mo", attr)
               << convertDelimToXMLEscape(right_)
               << ETagInline("mo")
               << ETag("mrow");