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())) << " -->";
- ms << MTag("mi");
+ ms << MTagInline("mi");
NormalStream ns(ms.os());
normalize(ns);
- ms << ETag("mi");
+ ms << ETagInline("mi");
}
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");
}
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");
}
}
if (!entity.empty()) {
- ms << "<" << from_ascii(ms.namespacedTag("mo")) << ">"
+ ms << MTagInline("mo")
<< from_ascii(entity)
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">";
+ << ETagInline("mo");
return;
}
? "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
{
- 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");
}
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
{
- ms << "<" << from_ascii(ms.namespacedTag("mi")) << ">"
+ ms << MTagInline("mi")
<< name_
- << "</" << from_ascii(ms.namespacedTag("mi")) << ">"
- << "<" << from_ascii(ms.namespacedTag("mo")) << ">"
+ << ETagInline("mi")
+ << MTagInline("mo")
<< "⁡"
- << "</" << from_ascii(ms.namespacedTag("mo")) << ">"
+ << ETagInline("mo")
<< cell(0);
}
void InsetMathNumber::mathmlize(MathMLStream & ms) const
{
- ms << "<" << from_ascii(ms.namespacedTag("mn")) << ">"
+ ms << MTagInline("mn")
<< str_
- << "</" << from_ascii(ms.namespacedTag("mn")) << ">";
+ << ETagInline("mn");
}
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 {