[LyX/master] InsetMathSpace: use XML entities instead of HTML in MathML.

Thibaut Cuvelier tcuvelier at lyx.org
Mon Dec 26 18:38:17 UTC 2022


commit 9b80a5ba9e1d072daa9ec3fd3e6470e5460db1f4
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Mon Dec 26 20:35:26 2022 +0100

    InsetMathSpace: use XML entities instead of HTML in MathML.
    
    This part should have been committed with bc73a857 in the first place.
---
 src/mathed/InsetMathSpace.cpp |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/mathed/InsetMathSpace.cpp b/src/mathed/InsetMathSpace.cpp
index 874012d..f507592 100644
--- a/src/mathed/InsetMathSpace.cpp
+++ b/src/mathed/InsetMathSpace.cpp
@@ -203,11 +203,8 @@ void InsetMathSpace::mathmlize(MathMLStream & ms) const
 	string l;
 	if (si.custom)
 		l = length_.asHTMLString();
-	else if (si.kind != InsetSpaceParams::MEDIUM) {
-		stringstream ss;
-		ss << si.width;
-		l = ss.str() + "px";
-	}
+	else if (si.kind != InsetSpaceParams::MEDIUM)
+		l = to_string(si.width) + "px";
 
 	std::string attr;
 	if (!l.empty())
@@ -222,23 +219,23 @@ void InsetMathSpace::htmlize(HtmlStream & ms) const
 	SpaceInfo const & si = space_info[space_];
 	switch (si.kind) {
 	case InsetSpaceParams::THIN:
-		ms << from_ascii(" ");
+		ms << from_ascii("&#x2009;"); // HTML:  
 		break;
 	case InsetSpaceParams::MEDIUM:
 		ms << from_ascii(" ");
 		break;
 	case InsetSpaceParams::THICK:
-		ms << from_ascii(" ");
+		ms << from_ascii("&#x2003;"); // HTML:  
 		break;
 	case InsetSpaceParams::ENSKIP:
 	case InsetSpaceParams::ENSPACE:
-		ms << from_ascii(" ");
+		ms << from_ascii("&#x2002;"); // HTML:  
 		break;
 	case InsetSpaceParams::QUAD:
-		ms << from_ascii(" ");
+		ms << from_ascii("&#x2003;"); // HTML:  
 		break;
 	case InsetSpaceParams::QQUAD:
-		ms << from_ascii("  ");
+		ms << from_ascii("&#x2003;&#x2003;"); // HTML:   
 		break;
 	case InsetSpaceParams::HFILL:
 	case InsetSpaceParams::HFILL_PROTECTED:


More information about the lyx-cvs mailing list