mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-28 06:49:43 +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,40 +88,78 @@ void InsetMathXArrow::mathmlize(MathStream & ms) const
|
|||||||
{
|
{
|
||||||
char const * arrow;
|
char const * arrow;
|
||||||
|
|
||||||
if (name_ == "xleftarrow")
|
if (!ms.xmlMode()) { // Use HTML entities.
|
||||||
arrow = "←";
|
if (name_ == "xleftarrow")
|
||||||
else if (name_ == "xrightarrow")
|
arrow = "←";
|
||||||
arrow = "→";
|
else if (name_ == "xrightarrow")
|
||||||
else if (name_ == "xhookleftarrow")
|
arrow = "→";
|
||||||
arrow = "↩";
|
else if (name_ == "xhookleftarrow")
|
||||||
else if (name_ == "xhookrightarrow")
|
arrow = "↩";
|
||||||
arrow = "↪";
|
else if (name_ == "xhookrightarrow")
|
||||||
else if (name_ == "xLeftarrow")
|
arrow = "↪";
|
||||||
arrow = "⇐";
|
else if (name_ == "xLeftarrow")
|
||||||
else if (name_ == "xRightarrow")
|
arrow = "⇐";
|
||||||
arrow = "⇒";
|
else if (name_ == "xRightarrow")
|
||||||
else if (name_ == "xleftrightarrow")
|
arrow = "⇒";
|
||||||
arrow = "↔";
|
else if (name_ == "xleftrightarrow")
|
||||||
else if (name_ == "xLeftrightarrow")
|
arrow = "↔";
|
||||||
arrow = "⇔";
|
else if (name_ == "xLeftrightarrow")
|
||||||
else if (name_ == "xleftharpoondown")
|
arrow = "⇔";
|
||||||
arrow = "↽";
|
else if (name_ == "xleftharpoondown")
|
||||||
else if (name_ == "xleftharpoonup")
|
arrow = "↽";
|
||||||
arrow = "↼";
|
else if (name_ == "xleftharpoonup")
|
||||||
else if (name_ == "xleftrightharpoons")
|
arrow = "↼";
|
||||||
arrow = "⇋";
|
else if (name_ == "xleftrightharpoons")
|
||||||
else if (name_ == "xrightharpoondown")
|
arrow = "⇋";
|
||||||
arrow = "⇁";
|
else if (name_ == "xrightharpoondown")
|
||||||
else if (name_ == "xrightharpoonup")
|
arrow = "⇁";
|
||||||
arrow = "⇀";
|
else if (name_ == "xrightharpoonup")
|
||||||
else if (name_ == "xrightleftharpoons")
|
arrow = "⇀";
|
||||||
arrow = "⇌";
|
else if (name_ == "xrightleftharpoons")
|
||||||
else if (name_ == "xmapsto")
|
arrow = "⇌";
|
||||||
arrow = "↦";
|
else if (name_ == "xmapsto")
|
||||||
else {
|
arrow = "↦";
|
||||||
lyxerr << "mathmlize conversion for '" << name_ << "' not implemented" << endl;
|
else {
|
||||||
LASSERT(false, arrow = "→");
|
lyxerr << "mathmlize conversion for '" << name_ << "' not implemented" << endl;
|
||||||
|
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