+ // Start outputting this inset.
+ // - First, wrapper around the inset and its main tag.
+ if (writeOuterTag) {
+ if (!il.docbookwrappertag().empty() && il.docbookwrappertag() != "NONE" && il.docbookwrappertag() != "IGNORE")
+ xml::openTag(xs, il.docbookwrappertag(), il.docbookwrapperattr(), il.docbookwrappertagtype());
+
+ if (!il.docbooktag().empty() && il.docbooktag() != "NONE" && il.docbooktag() != "IGNORE") {
+ docstring attrs = docstring();
+ if (!il.docbookattr().empty())
+ attrs += from_ascii(il.docbookattr());
+ if (il.docbooktag() == "link")
+ attrs += from_ascii(" xlink:href=\"") + text_.asString() + from_ascii("\"");
+ xml::openTag(xs, il.docbooktag(), attrs, il.docbooktagtype());
+ }
+ }
+
+ // - Think about the arguments before the paragraph.
+ OutputParams np = runparams;
+ np.docbook_in_par = true;
+ for (auto const & arg : prependedArguments)
+ arg->docbook(xs, np);
+
+ // - Mark the newly generated arguments are not-to-be-generated-again. Do the same for arguments that will follow.
+ runparams.docbook_prepended_arguments = std::move(prependedArguments);
+ runparams.docbook_appended_arguments = appendedArguments;
+
+ // - Deal with the first item.
+ // TODO: in things like SciPoster, this should also check if the item tag is allowed. Hard to formalise for now...
+ if (writeOuterTag) {
+ if (!il.docbookitemwrappertag().empty() && il.docbookitemwrappertag() != "NONE" && il.docbookitemwrappertag() != "IGNORE")
+ xml::openTag(xs, il.docbookitemwrappertag(), il.docbookitemwrapperattr(), il.docbookitemwrappertagtype());
+
+ if (!il.docbookitemtag().empty() && il.docbookitemtag() != "NONE" && il.docbookitemtag() != "IGNORE")
+ xml::openTag(xs, il.docbookitemtag(), il.docbookitemattr(), il.docbookitemtagtype());
+ }
+
+ // No need for labels that are generated from counters. They should be handled by the external DocBook processor.
+
+ // With respect to XHTML, paragraphs are still allowed here.
+ if (runparams.docbook_consider_allow_multi_par && !allowMultiPar())
+ runparams.docbook_make_pars = false;
+ if (il.isPassThru())
+ runparams.pass_thru = true;
+
+ // - Write the main content of the inset.
+ xs.startDivision(false);
+ docbookParagraphs(text_, buffer(), xs, runparams);
+ xs.endDivision();
+
+ // - Think about the arguments after the paragraph.
+ for (auto const & arg : appendedArguments)
+ arg->docbook(xs, np);