DocBook: for MathML, mrow removal for more cases

By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0003-tag-insertion-unification-for-bold-char-delim-dots-exfunc-.patch
This commit is contained in:
Thibaut Cuvelier 2021-05-25 03:29:20 +02:00
parent 5eddfe509b
commit a579128c06
4 changed files with 7 additions and 8 deletions

View File

@ -36,8 +36,6 @@ using namespace std;
namespace lyx {
extern bool has_math_fonts;
namespace {
latexkeys const * makeSubstitute(char_type c)

View File

@ -142,9 +142,9 @@ void InsetMathExInt::mathmlize(MathMLStream & ms) const
sym.mathmlize(ms);
ms << ETag("mrow");
if (lower)
ms << MTag("mrow") << cell(2) << ETag("mrow");
ms << cell(2);
if (upper)
ms << MTag("mrow") << cell(3) << ETag("mrow");
ms << cell(3);
if (lower && upper)
ms << ETag("msubsup");
else if (lower)

View File

@ -624,7 +624,7 @@ void InsetMathScript::mathmlize(MathMLStream & ms) const
if (!nuc().empty())
ms << nuc();
else
ms << "<" << from_ascii(ms.namespacedTag("mrow")) << " />";
ms << CTag("mrow");
if (d)
ms << MTag("mrow") << down() << ETag("mrow");

View File

@ -209,10 +209,11 @@ void InsetMathSpace::mathmlize(MathMLStream & ms) const
l = ss.str() + "px";
}
ms << "<" << from_ascii(ms.namespacedTag("mspace"));
std::string attr;
if (!l.empty())
ms << " width=\"" << from_ascii(l) << "\"";
ms << " />";
attr = "width=\"" + l + "\"";
ms << CTag("mspace", attr);
}