]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/MathParser.cpp
Substack support for XHTML.
[lyx.git] / src / mathed / MathParser.cpp
index 1803da7f3a217917912e1989bf0b2bfb2e37eea4..ad52e76105c3a0a0f8038672cdaa3230bf53237f 100644 (file)
@@ -1348,7 +1348,7 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
 #endif
 
                else if (t.cs() == "limits" || t.cs() == "nolimits") {
-                       CatCode cat = nextToken().cat();
+                       CatCode const cat = nextToken().cat();
                        if (cat == catSuper || cat == catSub)
                                limits = t.cs() == "limits" ? 1 : -1;
                        else {
@@ -1727,6 +1727,14 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
                                delEmptyLastRow(subgrid);
                }
 
+               else if (t.cs() == "Diagram") {
+                       odocstringstream os;
+                       while (good() && nextToken().cat() != catBegin)
+                               os << getToken().asInput();
+                       cell->push_back(createInsetMath(t.cs() + os.str(), buf));
+                       parse2(cell->back(), FLAG_ITEM, mode, false);
+               }
+
                else if (t.cs() == "framebox" || t.cs() == "makebox") {
                        cell->push_back(createInsetMath(t.cs(), buf));
                        parse(cell->back().nucleus()->cell(0), FLAG_OPTION, InsetMath::TEXT_MODE);
@@ -1823,12 +1831,15 @@ bool Parser::parse1(InsetMathGrid & grid, unsigned flags,
 
                else if (t.cs().size()) {
                        bool const no_mhchem =
-                               (t.cs() == "ce" || t.cs() == "cf") && buf
-                               && buf->params().use_mhchem == BufferParams::package_off;
+                               (t.cs() == "ce" || t.cs() == "cf")
+                               && buf && buf->params().use_mhchem ==
+                                               BufferParams::package_off;
+
                        bool const is_user_macro = no_mhchem ||
                                (buf && (mode_ & Parse::TRACKMACRO
-                                       ? buf->usermacros.count(t.cs()) != 0
-                                       : buf->getMacro(t.cs(), false) != 0));
+                                        ? buf->usermacros.count(t.cs()) != 0
+                                        : buf->getMacro(t.cs(), false) != 0));
+
                        latexkeys const * l = in_word_set(t.cs());
                        if (l && !is_user_macro) {
                                if (l->inset == "big") {