[LyX/master] DocBook: for MathML, mrow removal from decoration, script, frac

Thibaut Cuvelier tcuvelier at lyx.org
Tue May 25 01:44:58 UTC 2021


commit 1cbac6fcb40d6e0803198624c047769adec2fe09
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Tue May 25 03:15:48 2021 +0200

    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 cc4ba16..a5d616e 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)
 	   << "</" << from_ascii(ms.namespacedTag("mo")) << ">"
diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp
index 2ad44fc..e58a787 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 c06291e..919c0b9 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");
 }
 
 


More information about the lyx-cvs mailing list