]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathHull.cpp
Revert "XHTML: remove DOCTYPE, as the document is then understood as HTML4/XHTML1...
[lyx.git] / src / mathed / InsetMathHull.cpp
index 58471210698aa5da58d029ffcedab1046f47f06d..e7326b64e59ae95d96328884d42748f443c9c5b3 100644 (file)
@@ -2418,18 +2418,16 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
 {
        // Choose the tag around the MathML equation.
        docstring name;
+       bool doCR = false;
        if (getType() == hullSimple)
                name = from_ascii("inlineequation");
        else {
-               // This is a block equation, always have <informalequation> on its own line.
-               if (!xs.isLastTagCR())
-                       xs << xml::CR();
-
+               doCR = true; // This is a block equation, always have <informalequation> on its own line.
                name = from_ascii("informalequation");
        }
 
        // DocBook also has <equation>, but it comes with a title.
-       // TODO: recognise \tag from amsmath?
+       // TODO: recognise \tag from amsmath? This would allow having <equation> with a proper title.
 
        docstring attr;
        for (row_type i = 0; i < nrows(); ++i) {
@@ -2439,6 +2437,10 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
                }
        }
 
+       if (doCR)
+               if (!xs.isLastTagCR())
+                       xs << xml::CR();
+
        xs << xml::StartTag(name, attr);
        xs << xml::CR();
 
@@ -2485,6 +2487,8 @@ void InsetMathHull::docbook(XMLStream & xs, OutputParams const & runparams) cons
        xs << XMLStream::ESCAPE_NONE << osmath.str();
        xs << xml::CR();
        xs << xml::EndTag(name);
+       if (doCR)
+               xs << xml::CR();
 }