We need to output the deferred material AFTER the paragraph is closed.
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;
LabelString unlabelled
LatexName caption*
ResetArgs 1
+ HTMLAttr "class='float-caption float-caption-unnumbered'"
End
}
-docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
+docstring InsetCaption::xhtml(XHTMLStream &, OutputParams const & rp) const
{
if (rp.html_disable_captions)
return docstring();
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();
}
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);
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();
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());
}
}
}
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;
}