docstring InsetText::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
+{
+ return insetAsXHTML(xs, runparams, WriteEverything);
+}
+
+
+docstring InsetText::insetAsXHTML(XHTMLStream & xs, OutputParams const & runparams,
+ XHTMLOptions opts) const
{
if (undefined()) {
xhtmlParagraphs(text_, buffer(), xs, runparams);
}
InsetLayout const & il = getLayout();
- xs << StartTag(il.htmltag(), il.htmlattr());
- if (!il.counter().empty()) {
+ if (opts & WriteOuterTag)
+ xs << StartTag(il.htmltag(), il.htmlattr());
+ if ((opts & WriteLabel) && !il.counter().empty()) {
BufferParams const & bp = buffer().masterBuffer()->params();
Counters & cntrs = bp.documentClass().counters();
cntrs.step(il.counter());
}
}
- xs << StartTag(il.htmlinnertag(), il.htmlinnerattr());
+ if (opts & WriteInnerTag)
+ xs << StartTag(il.htmlinnertag(), il.htmlinnerattr());
if (il.isMultiPar())
xhtmlParagraphs(text_, buffer(), xs, runparams);
else {
ours.html_make_pars = false;
xhtmlParagraphs(text_, buffer(), xs, ours);
}
- xs << EndTag(il.htmlinnertag());
- xs << EndTag(il.htmltag());
+ if (opts & WriteInnerTag)
+ xs << EndTag(il.htmlinnertag());
+ if (opts & WriteOuterTag)
+ xs << EndTag(il.htmltag());
return docstring();
}
int docbook(odocstream &, OutputParams const &) const;
///
docstring xhtml(XHTMLStream &, OutputParams const &) const;
+ ///
+ enum XHTMLOptions {
+ JustText = 0,
+ WriteOuterTag = 1,
+ WriteLabel = 2,
+ WriteInnerTag = 4,
+ WriteEverything = 7
+ };
+ ///
+ docstring insetAsXHTML(XHTMLStream &, OutputParams const &,
+ XHTMLOptions) const;
// FIXME XHTMLStream to be removed
docstring xhtml(odocstream &, OutputParams const &) const
{ return docstring (); }