From 1cbac6fcb40d6e0803198624c047769adec2fe09 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Tue, 25 May 2021 03:15:48 +0200 Subject: [PATCH] DocBook: for MathML, mrow removal from decoration, script, frac By lynx: https://www.lyx.org/trac/attachment/ticket/12221/0002-mrow-removal-from-decoration-script-frac.patch --- src/mathed/InsetMathDecoration.cpp | 2 +- src/mathed/InsetMathFrac.cpp | 12 ++++++------ src/mathed/InsetMathScript.cpp | 8 +++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index cc4ba16279..a5d616eed3 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -246,7 +246,7 @@ void InsetMathDecoration::mathmlize(MathMLStream & ms) const char const * const outag = cur->second.over ? "mover" : "munder"; std::string decoration = ms.xmlMode() ? cur->second.entity : cur->second.tag; ms << MTag(outag) - << MTag("mrow") << cell(0) << ETag("mrow") + << cell(0) << "<" << from_ascii(ms.namespacedTag("mo")) << " stretchy=\"true\">" << from_ascii(decoration) << "" diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 2ad44fc6ef..e58a787057 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -521,15 +521,15 @@ void InsetMathFrac::mathmlize(MathMLStream & ms) const case CFRACRIGHT: case AASTEX_CASE: ms << MTag("mfrac") - << MTag("mrow") << cell(0) << ETag("mrow") - << MTag("mrow") << cell(1) << ETag("mrow") + << cell(0) + << cell(1) << ETag("mfrac"); break; case NICEFRAC: ms << MTag("mfrac", "bevelled='true'") - << MTag("mrow") << cell(0) << ETag("mrow") - << MTag("mrow") << cell(1) << ETag("mrow") + << cell(0) + << cell(1) << ETag("mfrac"); break; @@ -537,8 +537,8 @@ void InsetMathFrac::mathmlize(MathMLStream & ms) const if (nargs() == 3) ms << cell(2); ms << MTag("mfrac", "bevelled='true'") - << MTag("mrow") << cell(0) << ETag("mrow") - << MTag("mrow") << cell(1) << ETag("mrow") + << cell(0) + << cell(1) << ETag("mfrac"); break; diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index c06291e31d..919c0b90d2 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -617,7 +617,7 @@ void InsetMathScript::mathmlize(MathMLStream & ms) const ms << MTag(l ? "munder" : "msub"); if (!nuc().empty()) - ms << MTag("mrow") << nuc() << ETag("mrow"); + ms << nuc(); else ms << "<" << from_ascii(ms.namespacedTag("mrow")) << " />"; @@ -626,9 +626,11 @@ void InsetMathScript::mathmlize(MathMLStream & ms) const << MTag("mrow") << up() << ETag("mrow") << ETag(l ? "munderover" : "msubsup"); else if (u) - ms << MTag("mrow") << up() << ETag("mrow") << ETag(l ? "mover" : "msup"); + ms << MTag("mrow") << up() << ETag("mrow") + << ETag(l ? "mover" : "msup"); else if (d) - ms << MTag("mrow") << down() << ETag("mrow") << ETag(l ? "munder" : "msub"); + ms << MTag("mrow") << down() << ETag("mrow") + << ETag(l ? "munder" : "msub"); } -- 2.39.5