commit eeb6b5b1533670fa4bb0793af9ec68d47dbcd5f3
Author: Richard Heck <[email protected]>
Date:   Sat Jul 30 01:42:08 2016 -0400

    Revert most of dd7863b6.
    
    I did not mean to commit the caption-related stuff.
---
 lib/layouts/stdinsets.inc   |    4 +---
 src/insets/InsetCaption.cpp |   14 +++++---------
 src/insets/InsetFloat.cpp   |    2 +-
 src/insets/InsetText.cpp    |    8 ++++----
 4 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc
index 3f6a4a6..a40572f 100644
--- a/lib/layouts/stdinsets.inc
+++ b/lib/layouts/stdinsets.inc
@@ -556,14 +556,13 @@ 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;
@@ -581,7 +580,6 @@ InsetLayout Caption:Unnumbered
        LabelString          unlabelled
        LatexName            caption*
        ResetArgs            1
-       HTMLAttr "class='float-caption float-caption-unnumbered'"
 End
 
 
diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp
index 149a40c..613249b 100644
--- a/src/insets/InsetCaption.cpp
+++ b/src/insets/InsetCaption.cpp
@@ -293,7 +293,7 @@ int InsetCaption::docbook(odocstream & os,
 }
 
 
-docstring InsetCaption::xhtml(XHTMLStream &, OutputParams const & rp) const
+docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 {
        if (rp.html_disable_captions)
                return docstring();
@@ -308,14 +308,10 @@ docstring InsetCaption::xhtml(XHTMLStream &, OutputParams 
const & rp) const
                else
                        attr = attr + " class='" + our_class + "'";
        }
-       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();
+       xs << html::StartTag(tag, attr);
+       docstring def = getCaptionAsHTML(xs, rp);
+       xs << html::EndTag(tag);
+       return def;
 }
 
 
diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index fa79c52..e1538e2 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -300,7 +300,7 @@ docstring InsetFloat::xhtml(XHTMLStream & xs, OutputParams 
const & rp) const
 
        odocstringstream ods;
        XHTMLStream newxs(ods);
-       newxs << html::StartTag(htmltype, attr) << html::CR();
+       newxs << html::StartTag(htmltype, attr);
        InsetText::XHTMLOptions const opts = 
                InsetText::WriteLabel | InsetText::WriteInnerTag;
        docstring deferred = InsetText::insetAsXHTML(newxs, rp, opts);
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 0bc38a3..df4f6e2 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -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()) << html::CR();
+               xs << html::StartTag(il.htmltag(), il.htmlattr());
 
        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())
-                                  << lbl
-                                  << html::EndTag(il.htmllabeltag());
+                               xs << html::StartTag(il.htmllabeltag(), 
il.htmllabelattr());
+                               xs << lbl;
+                               xs << html::EndTag(il.htmllabeltag());
                        }
                }
        }

Reply via email to