mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-28 23:15:19 +00:00
MathML: make InsetMathXArrow generate valid XML entities when required.
Before this, it only supported HTML entities.
This commit is contained in:
parent
8d33eb0351
commit
85a8664ba5
@ -88,6 +88,7 @@ void InsetMathXArrow::mathmlize(MathStream & ms) const
|
|||||||
{
|
{
|
||||||
char const * arrow;
|
char const * arrow;
|
||||||
|
|
||||||
|
if (!ms.xmlMode()) { // Use HTML entities.
|
||||||
if (name_ == "xleftarrow")
|
if (name_ == "xleftarrow")
|
||||||
arrow = "←";
|
arrow = "←";
|
||||||
else if (name_ == "xrightarrow")
|
else if (name_ == "xrightarrow")
|
||||||
@ -122,6 +123,43 @@ void InsetMathXArrow::mathmlize(MathStream & ms) const
|
|||||||
lyxerr << "mathmlize conversion for '" << name_ << "' not implemented" << endl;
|
lyxerr << "mathmlize conversion for '" << name_ << "' not implemented" << endl;
|
||||||
LASSERT(false, arrow = "→");
|
LASSERT(false, arrow = "→");
|
||||||
}
|
}
|
||||||
|
} else { // Use XML entities.
|
||||||
|
if (name_ == "xleftarrow")
|
||||||
|
arrow = "←";
|
||||||
|
else if (name_ == "xrightarrow")
|
||||||
|
arrow = "→";
|
||||||
|
else if (name_ == "xhookleftarrow")
|
||||||
|
arrow = "↩";
|
||||||
|
else if (name_ == "xhookrightarrow")
|
||||||
|
arrow = "↪";
|
||||||
|
else if (name_ == "xLeftarrow")
|
||||||
|
arrow = "⇐";
|
||||||
|
else if (name_ == "xRightarrow")
|
||||||
|
arrow = "⇒";
|
||||||
|
else if (name_ == "xleftrightarrow")
|
||||||
|
arrow = "↔";
|
||||||
|
else if (name_ == "xLeftrightarrow")
|
||||||
|
arrow = "⇔";
|
||||||
|
else if (name_ == "xleftharpoondown")
|
||||||
|
arrow = "↽";
|
||||||
|
else if (name_ == "xleftharpoonup")
|
||||||
|
arrow = "↼";
|
||||||
|
else if (name_ == "xleftrightharpoons")
|
||||||
|
arrow = "⇋";
|
||||||
|
else if (name_ == "xrightharpoondown")
|
||||||
|
arrow = "⇁";
|
||||||
|
else if (name_ == "xrightharpoonup")
|
||||||
|
arrow = "⇀";
|
||||||
|
else if (name_ == "xrightleftharpoons")
|
||||||
|
arrow = "⇌";
|
||||||
|
else if (name_ == "xmapsto")
|
||||||
|
arrow = "↦";
|
||||||
|
else {
|
||||||
|
lyxerr << "mathmlize XML conversion for '" << name_ << "' not implemented" << endl;
|
||||||
|
LASSERT(false, arrow = "→");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ms << "<" << from_ascii(ms.namespacedTag("munderover")) << " accent='false' accentunder='false'>"
|
ms << "<" << from_ascii(ms.namespacedTag("munderover")) << " accent='false' accentunder='false'>"
|
||||||
<< arrow << cell(1) << cell(0)
|
<< arrow << cell(1) << cell(0)
|
||||||
<< "</" << from_ascii(ms.namespacedTag("munderover"))<< ">";
|
<< "</" << from_ascii(ms.namespacedTag("munderover"))<< ">";
|
||||||
|
Loading…
Reference in New Issue
Block a user