MathML: don't output delimiters in InsetMathBinom and InsetMathDelim if the delimiter is a space.

This commit is contained in:
Thibaut Cuvelier 2023-10-08 02:12:35 +02:00 committed by Pavel Sanda
parent 072ba7bd2e
commit be44cb8516
2 changed files with 26 additions and 17 deletions

View File

@ -181,15 +181,19 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const
void InsetMathDelim::mathmlize(MathMLStream & ms) const
{
ms << MTag("mrow")
<< MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'")
<< convertDelimToXMLEscape(left_)
<< ETagInline("mo")
<< cell(0)
<< MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'")
<< convertDelimToXMLEscape(right_)
<< ETagInline("mo")
<< ETag("mrow");
if (left_.empty() || (left_.size() == 1 && left_[0] == ' ')) {
ms << MTag("mrow")
<< MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'")
<< convertDelimToXMLEscape(left_)
<< ETagInline("mo");
}
ms << cell(0);
if (right_.empty() || (right_.size() == 1 && right_[0] == ' ')) {
ms << MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'")
<< convertDelimToXMLEscape(right_)
<< ETagInline("mo")
<< ETag("mrow");
}
}

View File

@ -768,15 +768,20 @@ void InsetMathBinom::mathmlize(MathMLStream & ms) const
rdelim = ']';
break;
}
ms << MTagInline("mo", "fence='true' stretchy='true' form='prefix'")
<< ldelim
<< ETagInline("mo")
<< MTagInline("mfrac", "linethickness='0'")
if (ldelim != ' ') {
ms << MTagInline("mo", "fence='true' stretchy='true' form='prefix'")
<< ldelim
<< ETagInline("mo");
}
ms << MTagInline("mfrac", "linethickness='0'")
<< cell(0) << cell(1)
<< ETagInline("mfrac")
<< MTagInline("mo", "fence='true' stretchy='true' form='postfix'")
<< rdelim
<< ETagInline("mo");
<< ETagInline("mfrac");
if (rdelim != ' ') {
ms << MTagInline("mo", "fence='true' stretchy='true' form='postfix'")
<< rdelim
<< ETagInline("mo");
}
}