]> git.lyx.org Git - features.git/commitdiff
Fix thinko from earlier commit.
authorRichard Heck <rgheck@lyx.org>
Sat, 30 Jul 2016 05:29:06 +0000 (01:29 -0400)
committerRichard Heck <rgheck@lyx.org>
Sat, 30 Jul 2016 05:29:06 +0000 (01:29 -0400)
We need to output the deferred material AFTER the paragraph is closed.

lib/layouts/stdinsets.inc
src/insets/InsetCaption.cpp
src/insets/InsetFloat.cpp
src/insets/InsetText.cpp
src/output_xhtml.cpp

index a40572f9a8d1c88888fbb19b69c57aa500f4dac3..3f6a4a6114e9419733e77a5ec83e722df9124574 100644 (file)
@@ -556,13 +556,14 @@ InsetLayout Caption:Standard
        LabelString          standard
        LaTeXType            command
        LatexName            caption
-       NeedProtect          1
+       NeedProtect          1
        MultiPar             false
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
                InsertCotext  1
        EndArgument
+       HTMLTag               div
        HTMLStyle
                div.float-caption {
                        text-align: center;
@@ -580,6 +581,7 @@ InsetLayout Caption:Unnumbered
        LabelString          unlabelled
        LatexName            caption*
        ResetArgs            1
+       HTMLAttr "class='float-caption float-caption-unnumbered'"
 End
 
 
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();
 }
 
 
index e1538e2635f76d9365645ac5541ca25a866cc1a4..fa79c5238261405a088f6e3b2166f88477fa993a 100644 (file)
@@ -300,7 +300,7 @@ docstring InsetFloat::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 
        odocstringstream ods;
        XHTMLStream newxs(ods);
-       newxs << html::StartTag(htmltype, attr);
+       newxs << html::StartTag(htmltype, attr) << html::CR();
        InsetText::XHTMLOptions const opts = 
                InsetText::WriteLabel | InsetText::WriteInnerTag;
        docstring deferred = InsetText::insetAsXHTML(newxs, rp, opts);
index df4f6e219325cd34734ab72cb73e18bd426583f5..0bc38a3704419070f149497dd2386feeb9927218 100644 (file)
@@ -621,7 +621,7 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp,
 
        InsetLayout const & il = getLayout();
        if (opts & WriteOuterTag)
-               xs << html::StartTag(il.htmltag(), il.htmlattr());
+               xs << html::StartTag(il.htmltag(), il.htmlattr()) << html::CR();
 
        if ((opts & WriteLabel) && !il.counter().empty()) {
                BufferParams const & bp = buffer().masterBuffer()->params();
@@ -633,9 +633,9 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp,
                                cntrs.counterLabel(from_utf8(il.htmllabel()), bp.language->code());
                        // FIXME is this check necessary?
                        if (!lbl.empty()) {
-                               xs << html::StartTag(il.htmllabeltag(), il.htmllabelattr());
-                               xs << lbl;
-                               xs << html::EndTag(il.htmllabeltag());
+                               xs << html::StartTag(il.htmllabeltag(), il.htmllabelattr())
+                                  << lbl
+                                  << html::EndTag(il.htmllabeltag());
                        }
                }
        }
index 585ee2cb34e5c5b7d387275b6fee9b56bae73709..1dd4ef1bda1c73d0482a6a99f2b68185cfe8b3a4 100644 (file)
@@ -878,13 +878,14 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
                        runparams, text.outerFont(distance(begin, par)),
                        open_par, close_par);
 
-               if (!deferred.empty()) {
-                       xs << XHTMLStream::ESCAPE_NONE << deferred << html::CR();
-               }
                if (close_par) {
                        closeTag(xs, lay);
                        xs << html::CR();
                }
+
+               if (!deferred.empty()) {
+                       xs << XHTMLStream::ESCAPE_NONE << deferred << html::CR();
+               }
        }
        return pend;
 }