]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNewline.cpp
DocBook: escape IDs for InsetRef.
[lyx.git] / src / insets / InsetNewline.cpp
index b10954d4da659210f8192c273c7b47273bd2d87d..05c6ee417f2a7a5ab92980647e28e3af42d9cd31 100644 (file)
@@ -20,6 +20,7 @@
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
+#include "output_docbook.h"
 #include "output_xhtml.h"
 #include "texstream.h"
 
@@ -146,7 +147,9 @@ void InsetNewline::latex(otexstream & os, OutputParams const & rp) const
 {
        switch (params_.kind) {
                case InsetNewlineParams::NEWLINE:
-                       if (rp.inTableCell == OutputParams::PLAIN)
+                       if (!rp.newlinecmd.empty())
+                               os << "\\" << rp.newlinecmd << "\n";
+                       else if (rp.inTableCell == OutputParams::PLAIN)
                                os << "\\newline\n";
                        else
                                os << "\\\\\n";
@@ -169,16 +172,19 @@ int InsetNewline::plaintext(odocstringstream & os,
 }
 
 
-int InsetNewline::docbook(odocstream & os, OutputParams const &) const
+void InsetNewline::docbook(XMLStream & xs, OutputParams const & runparams) const
 {
-       os << '\n';
-       return 0;
+       if (runparams.docbook_in_par) {
+               xs.closeFontTags();
+               xs << xml::EndTag("para");
+               xs << xml::StartTag("para");
+       }
 }
 
 
-docstring InsetNewline::xhtml(XHTMLStream & xs, OutputParams const &) const
+docstring InsetNewline::xhtml(XMLStream & xs, OutputParams const &) const
 {
-       xs << html::CR() << html::CompTag("br") << html::CR();
+       xs << xml::CR() << xml::CompTag("br") << xml::CR();
        return docstring();
 }