]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetCaption.cpp
Fix thinko from earlier commit.
[features.git] / src / insets / InsetCaption.cpp
index 613249b6b25c28472c2134cbaf795e6ccc58153d..149a40c93b8cb7a5156f27905a078f0abca418cf 100644 (file)
@@ -293,7 +293,7 @@ int InsetCaption::docbook(odocstream & os,
 }
 
 
-docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
+docstring InsetCaption::xhtml(XHTMLStream &, OutputParams const & rp) const
 {
        if (rp.html_disable_captions)
                return docstring();
@@ -308,10 +308,14 @@ docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
                else
                        attr = attr + " class='" + our_class + "'";
        }
-       xs << html::StartTag(tag, attr);
-       docstring def = getCaptionAsHTML(xs, rp);
-       xs << html::EndTag(tag);
-       return def;
+       odocstringstream ods;
+       XHTMLStream ourxs(ods);
+       ourxs << html::StartTag(tag, attr) << html::CR();
+       docstring def = getCaptionAsHTML(ourxs, rp);
+       ourxs << html::EndTag(tag) << html::CR();
+       if (!def.empty())
+               return ods.str() + "\n" + def;
+       return ods.str();
 }