By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0003-tag-insertion-unification-for-bold-char-delim-dots-exfunc-.patch
void InsetMath::mathmlize(MathMLStream & ms) const
{
ms << "<!-- " << from_utf8(insetName(lyxCode())) << " -->";
void InsetMath::mathmlize(MathMLStream & ms) const
{
ms << "<!-- " << from_utf8(insetName(lyxCode())) << " -->";
+ ms << MTagInline("mi");
NormalStream ns(ms.os());
normalize(ns);
NormalStream ns(ms.os());
normalize(ns);
+ ms << ETagInline("mi");
void InsetMathBig::mathmlize(MathMLStream & ms) 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())
<< convertDelimToXMLEscape(delim_, ms.xmlMode())
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">";
void InsetMathBoldSymbol::mathmlize(MathMLStream & ms) const
{
void InsetMathBoldSymbol::mathmlize(MathMLStream & ms) const
{
- ms << "<" << from_ascii(ms.namespacedTag("mstyle")) << " mathvariant='bold'>"
+ ms << MTagInline("mstyle", "mathvariant='bold'>")
- << "</" << from_ascii(ms.namespacedTag("mstyle")) << ">";
+ << ETagInline("mstyle");
- ms << "<" << from_ascii(ms.namespacedTag("mo")) << ">"
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">";
? "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));
? "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);
void InsetMathDelim::mathmlize(MathMLStream & ms) 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())
<< convertDelimToXMLEscape(left_, ms.xmlMode())
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">"
<< "\n"
<< cell(0)
<< "\n"
<< "\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())
<< convertDelimToXMLEscape(right_, ms.xmlMode())
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">" << "\n"
- << "</" << from_ascii(ms.namespacedTag("mrow")) << ">" << "\n";
+ << ETagInline("mo")
+ << ETag("mrow");
ent = "⋮";
else LASSERT(false, ent = "…");
}
ent = "⋮";
else LASSERT(false, ent = "…");
}
- ms << MTag("mi") << from_ascii(ent) << ETag("mi");
+ ms << MTagInline("mi") << from_ascii(ent) << ETagInline("mi");
void InsetMathExFunc::mathmlize(MathMLStream & ms) const
{
void InsetMathExFunc::mathmlize(MathMLStream & ms) const
{
- ms << "<" << from_ascii(ms.namespacedTag("mi")) << ">"
- << "</" << from_ascii(ms.namespacedTag("mi")) << ">"
- << "<" << from_ascii(ms.namespacedTag("mo")) << ">"
+ << ETagInline("mi")
+ << MTagInline("mo")
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">"
void InsetMathNumber::mathmlize(MathMLStream & ms) const
{
void InsetMathNumber::mathmlize(MathMLStream & ms) const
{
- ms << "<" << from_ascii(ms.namespacedTag("mn")) << ">"
- << "</" << from_ascii(ms.namespacedTag("mn")) << ">";
MathData ar = dat;
extractStructure(ar, MATHML);
if (ar.empty())
MathData ar = dat;
extractStructure(ar, MATHML);
if (ar.empty())
- ms << "<" << from_ascii(ms.namespacedTag("mrow")) << "/>";
else if (ar.size() == 1)
ms << ar.front();
else {
else if (ar.size() == 1)
ms << ar.front();
else {