commit f248e3fb7aed6df541c419ca32b0e6a7dcb2a2c6
Author: Thibaut Cuvelier <[email protected]>
Date: Mon Mar 24 03:22:53 2025 +0100
MathStream: map character to fonts even if it's only a character.
For instance, previously, "a" couldn't get changed in \mathbf. Now, it can
(if we have the relevant info).
---
src/mathed/MathStream.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp
index 5b1d4f7816..5164d306ca 100644
--- a/src/mathed/MathStream.cpp
+++ b/src/mathed/MathStream.cpp
@@ -198,11 +198,12 @@ std::string MathFontInfo::toHTMLSpanClass() const
docstring MathFontInfo::convertCharacterToUnicodeEntityWithFont(const
docstring & c, bool in_text) const
{
- if (c.size() <= 1) {
- return c;
+ docstring mapped = convertCharacterToUnicodeWithFont(c, in_text);
+ if (mapped == c || mapped.length() == 1) {
+ return mapped;
}
// Otherwise, it's an entity, like 0x1d44e (as a hexadecimal number).
- return from_ascii("&#") + convertCharacterToUnicodeWithFont(c, in_text)
+ from_ascii(";");
+ return from_ascii("&#") + mapped + from_ascii(";");
}
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs