- features.useInsetLayout(getLayout());
- for_each(paragraphs().begin(), paragraphs().end(),
- bind(&Paragraph::validate, _1, ref(features)));
+ if (undefined()) {
+ xhtmlParagraphs(text_, buffer(), xs, runparams);
+ return docstring();
+ }
+
+ InsetLayout const & il = getLayout();
+ if (opts & WriteOuterTag)
+ xs << html::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(), OutputUpdate);
+ // FIXME: translate to paragraph language
+ if (!il.htmllabel().empty()) {
+ docstring const lbl =
+ 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());
+ }
+ }
+ }
+
+ if (opts & WriteInnerTag)
+ xs << html::StartTag(il.htmlinnertag(), il.htmlinnerattr());
+ OutputParams ours = runparams;
+ if (!il.isMultiPar() || opts == JustText)
+ ours.html_make_pars = false;
+ xhtmlParagraphs(text_, buffer(), xs, ours);
+ if (opts & WriteInnerTag)
+ xs << html::EndTag(il.htmlinnertag());
+ if (opts & WriteOuterTag)
+ xs << html::EndTag(il.htmltag());
+ return docstring();