]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCaption.cpp
Fix conflicting inset font defaults (bug #8874)
[lyx.git] / src / insets / InsetCaption.cpp
index f648362a147efad0ea100299e5c2de421213e41e..aaf06286f9abf3ee1f685b9b52ae5496d1f4e32b 100644 (file)
@@ -276,6 +276,9 @@ void InsetCaption::latex(otexstream & os,
        // optional argument.
        runparams.moving_arg = !runparams.inTableCell;
        InsetText::latex(os, runparams);
+       // Backwards compatibility: We always had a linebreak after
+       // the caption (see #8514)
+       os << breakln;
        runparams_in.encoding = runparams.encoding;
 }
 
@@ -313,7 +316,9 @@ docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
                string const our_class = "float-caption-" + type_;
                size_t const loc = attr.find("class='");
                if (loc != string::npos)
-                       attr.insert(loc + 1, our_class);
+                       attr.insert(loc + 7, our_class+ " ");
+               else
+                       attr = attr + " class='" + our_class + "'";
        }
        xs << html::StartTag(tag, attr);
        docstring def = getCaptionAsHTML(xs, rp);