Fix thinko from earlier commit.

We need to output the deferred material AFTER the paragraph is closed.
This commit is contained in:
Richard Heck 2016-07-30 01:29:06 -04:00
parent 60ce2b7570
commit dd7863b6ac
5 changed files with 21 additions and 14 deletions

View File

@ -556,13 +556,14 @@ InsetLayout Caption:Standard
LabelString standard LabelString standard
LaTeXType command LaTeXType command
LatexName caption LatexName caption
NeedProtect 1 NeedProtect 1
MultiPar false MultiPar false
Argument 1 Argument 1
LabelString "Short Title|S" LabelString "Short Title|S"
Tooltip "The caption as it appears in the list of figures/tables" Tooltip "The caption as it appears in the list of figures/tables"
InsertCotext 1 InsertCotext 1
EndArgument EndArgument
HTMLTag div
HTMLStyle HTMLStyle
div.float-caption { div.float-caption {
text-align: center; text-align: center;
@ -580,6 +581,7 @@ InsetLayout Caption:Unnumbered
LabelString unlabelled LabelString unlabelled
LatexName caption* LatexName caption*
ResetArgs 1 ResetArgs 1
HTMLAttr "class='float-caption float-caption-unnumbered'"
End End

View 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) if (rp.html_disable_captions)
return docstring(); return docstring();
@ -308,10 +308,14 @@ docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
else else
attr = attr + " class='" + our_class + "'"; attr = attr + " class='" + our_class + "'";
} }
xs << html::StartTag(tag, attr); odocstringstream ods;
docstring def = getCaptionAsHTML(xs, rp); XHTMLStream ourxs(ods);
xs << html::EndTag(tag); ourxs << html::StartTag(tag, attr) << html::CR();
return def; docstring def = getCaptionAsHTML(ourxs, rp);
ourxs << html::EndTag(tag) << html::CR();
if (!def.empty())
return ods.str() + "\n" + def;
return ods.str();
} }

View File

@ -300,7 +300,7 @@ docstring InsetFloat::xhtml(XHTMLStream & xs, OutputParams const & rp) const
odocstringstream ods; odocstringstream ods;
XHTMLStream newxs(ods); XHTMLStream newxs(ods);
newxs << html::StartTag(htmltype, attr); newxs << html::StartTag(htmltype, attr) << html::CR();
InsetText::XHTMLOptions const opts = InsetText::XHTMLOptions const opts =
InsetText::WriteLabel | InsetText::WriteInnerTag; InsetText::WriteLabel | InsetText::WriteInnerTag;
docstring deferred = InsetText::insetAsXHTML(newxs, rp, opts); docstring deferred = InsetText::insetAsXHTML(newxs, rp, opts);

View File

@ -621,7 +621,7 @@ docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & rp,
InsetLayout const & il = getLayout(); InsetLayout const & il = getLayout();
if (opts & WriteOuterTag) 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()) { if ((opts & WriteLabel) && !il.counter().empty()) {
BufferParams const & bp = buffer().masterBuffer()->params(); 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()); cntrs.counterLabel(from_utf8(il.htmllabel()), bp.language->code());
// FIXME is this check necessary? // FIXME is this check necessary?
if (!lbl.empty()) { if (!lbl.empty()) {
xs << html::StartTag(il.htmllabeltag(), il.htmllabelattr()); xs << html::StartTag(il.htmllabeltag(), il.htmllabelattr())
xs << lbl; << lbl
xs << html::EndTag(il.htmllabeltag()); << html::EndTag(il.htmllabeltag());
} }
} }
} }

View File

@ -878,13 +878,14 @@ ParagraphList::const_iterator makeParagraphs(Buffer const & buf,
runparams, text.outerFont(distance(begin, par)), runparams, text.outerFont(distance(begin, par)),
open_par, close_par); open_par, close_par);
if (!deferred.empty()) {
xs << XHTMLStream::ESCAPE_NONE << deferred << html::CR();
}
if (close_par) { if (close_par) {
closeTag(xs, lay); closeTag(xs, lay);
xs << html::CR(); xs << html::CR();
} }
if (!deferred.empty()) {
xs << XHTMLStream::ESCAPE_NONE << deferred << html::CR();
}
} }
return pend; return pend;
} }