From 8f820d7ccb0cb6129c8e3c1d495905d61db97355 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Mon, 11 Mar 2024 01:40:16 +0100 Subject: [PATCH] MathML: stop stretching all delimiters. 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index d32029b818..fab72db88d 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -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");