Thibaut Cuvelier 2021-05-25 03:51:29 +02:00
parent 3ab6633b86
commit a68e979350
9 changed files with 25 additions and 24 deletions

View File

@ -205,10 +205,10 @@ void InsetMath::mathematica(MathematicaStream & os) const
void InsetMath::mathmlize(MathMLStream & ms) const
{
ms << "<!-- " << from_utf8(insetName(lyxCode())) << " -->";
ms << MTag("mi");
ms << MTagInline("mi");
NormalStream ns(ms.os());
normalize(ns);
ms << ETag("mi");
ms << ETagInline("mi");
}

View File

@ -137,10 +137,9 @@ void InsetMathBig::normalize(NormalStream & os) const
void InsetMathBig::mathmlize(MathMLStream & ms) const
{
ms << "<" << from_ascii(ms.namespacedTag("mo"))
<< " form='prefix' fence='true' stretchy='true' symmetric='true'>"
ms << MTagInline("mo", "fence='true' stretchy='true' symmetric='true'>")
<< convertDelimToXMLEscape(delim_, ms.xmlMode())
<< "</" << from_ascii(ms.namespacedTag("mo")) << ">";
<< ETagInline("mo");
}

View File

@ -109,9 +109,9 @@ void InsetMathBoldSymbol::write(TeXMathStream & os) const
void InsetMathBoldSymbol::mathmlize(MathMLStream & ms) const
{
ms << "<" << from_ascii(ms.namespacedTag("mstyle")) << " mathvariant='bold'>"
ms << MTagInline("mstyle", "mathvariant='bold'>")
<< cell(0)
<< "</" << from_ascii(ms.namespacedTag("mstyle")) << ">";
<< ETagInline("mstyle");
}

View File

@ -252,9 +252,9 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const
}
if (!entity.empty()) {
ms << "<" << from_ascii(ms.namespacedTag("mo")) << ">"
ms << MTagInline("mo")
<< from_ascii(entity)
<< "</" << from_ascii(ms.namespacedTag("mo")) << ">";
<< ETagInline("mo");
return;
}
@ -263,7 +263,9 @@ void InsetMathChar::mathmlize(MathMLStream & ms) const
? "mi" : "mo";
// we don't use MTag and ETag because we do not want the spacing before the end tag.
docstring tag = from_ascii(ms.namespacedTag(type));
ms << "<" << tag << ">" << char_type(char_) << "</" << tag << ">";
ms << MTagInline(type)
<< char_type(char_)
<< ETagInline(type);
}

View File

@ -181,17 +181,17 @@ void InsetMathDelim::mathematica(MathematicaStream & os) const
void InsetMathDelim::mathmlize(MathMLStream & ms) const
{
ms << "<" << from_ascii(ms.namespacedTag("mrow")) << ">" << "\n"
<< "<" << from_ascii(ms.namespacedTag("mo")) << " form='prefix' fence='true' stretchy='true' symmetric='true'>"
ms << MTag("mrow")
<< MTagInline("mo", "form='prefix' fence='true' stretchy='true' symmetric='true'>")
<< convertDelimToXMLEscape(left_, ms.xmlMode())
<< "</" << from_ascii(ms.namespacedTag("mo")) << ">"
<< ETagInline("mo")
<< "\n"
<< cell(0)
<< "\n"
<< "<" << from_ascii(ms.namespacedTag("mo")) << " form='postfix' fence='true' stretchy='true' symmetric='true'>"
<< MTagInline("mo", "form='postfix' fence='true' stretchy='true' symmetric='true'>")
<< convertDelimToXMLEscape(right_, ms.xmlMode())
<< "</" << from_ascii(ms.namespacedTag("mo")) << ">" << "\n"
<< "</" << from_ascii(ms.namespacedTag("mrow")) << ">" << "\n";
<< ETagInline("mo")
<< ETag("mrow");
}

View File

@ -105,7 +105,7 @@ void InsetMathDots::mathmlize(MathMLStream & ms) const
ent = "&vellip;";
else LASSERT(false, ent = "&hellip;");
}
ms << MTag("mi") << from_ascii(ent) << ETag("mi");
ms << MTagInline("mi") << from_ascii(ent) << ETagInline("mi");
}

View File

@ -124,12 +124,12 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const
void InsetMathExFunc::mathmlize(MathMLStream & ms) const
{
ms << "<" << from_ascii(ms.namespacedTag("mi")) << ">"
ms << MTagInline("mi")
<< name_
<< "</" << from_ascii(ms.namespacedTag("mi")) << ">"
<< "<" << from_ascii(ms.namespacedTag("mo")) << ">"
<< ETagInline("mi")
<< MTagInline("mo")
<< "&af;"
<< "</" << from_ascii(ms.namespacedTag("mo")) << ">"
<< ETagInline("mo")
<< cell(0);
}

View File

@ -70,9 +70,9 @@ void InsetMathNumber::octave(OctaveStream & os) const
void InsetMathNumber::mathmlize(MathMLStream & ms) const
{
ms << "<" << from_ascii(ms.namespacedTag("mn")) << ">"
ms << MTagInline("mn")
<< str_
<< "</" << from_ascii(ms.namespacedTag("mn")) << ">";
<< ETagInline("mn");
}

View File

@ -1591,7 +1591,7 @@ void mathmlize(MathData const & dat, MathMLStream & ms)
MathData ar = dat;
extractStructure(ar, MATHML);
if (ar.empty())
ms << "<" << from_ascii(ms.namespacedTag("mrow")) << "/>";
ms << CTag("mrow");
else if (ar.size() == 1)
ms << ar.front();
else {