+docstring InsetListings::xhtml(odocstream & os, OutputParams const & rp) const
+{
+ odocstringstream out;
+
+ bool const isInline = params().isInline();
+ if (isInline)
+ out << "<br />\n";
+ else {
+ out << "<div class='float float-listings'>\n";
+ docstring caption = getCaptionHTML(rp);
+ if (!caption.empty())
+ out << "<div class='float-caption'>" << caption << "</div>\n";
+ }
+
+ out << "<pre>\n";
+ docstring def = InsetText::xhtml(out, rp);
+ out << "\n</pre>\n";
+
+ if (isInline) {
+ out << "<br />\n";
+ os << out.str();
+ } else {
+ out << "</div>";
+ // In this case, this needs to be deferred, but we'll put it
+ // before anything the text itself deferred.
+ def = out.str() + '\n' + def;
+ }
+ return def;
+}
+
+