#include "FuncStatus.h"
#include "InsetCaption.h"
#include "Language.h"
+#include "Lexer.h"
#include "MetricsInfo.h"
#include "output_latex.h"
+#include "output_xhtml.h"
#include "TextClass.h"
#include "support/debug.h"
}
-void InsetListings::updateLabels(ParIterator const & it, bool out)
+void InsetListings::updateBuffer(ParIterator const & it, UpdateType utype)
{
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
string const saveflt = cnts.current_float();
// Tell to captions what the current float is
cnts.current_float("listing");
- InsetCollapsable::updateLabels(it, out);
+ InsetCollapsable::updateBuffer(it, utype);
//reset afterwards
cnts.current_float(saveflt);
}
-docstring InsetListings::xhtml(odocstream & os, OutputParams const & rp) const
+docstring InsetListings::xhtml(XHTMLStream & os, OutputParams const & rp) const
{
- odocstringstream out;
+ odocstringstream ods;
+ XHTMLStream out(ods);
bool const isInline = params().isInline();
if (isInline)
- out << "<br />\n";
+ out << html::CompTag("br");
else {
- out << "<div class='float float-listings'>\n";
+ out << html::StartTag("div", "class='float float-listings'");
docstring caption = getCaptionHTML(rp);
if (!caption.empty())
- out << "<div class='float-caption'>" << caption << "</div>\n";
+ out << html::StartTag("div", "class='float-caption'")
+ << caption << html::EndTag("div");
}
- out << "<pre>\n";
+ out << html::StartTag("pre");
OutputParams newrp = rp;
newrp.html_disable_captions = true;
- docstring def = InsetText::xhtml(out, newrp);
- out << "\n</pre>\n";
+ docstring def = InsetText::insetAsXHTML(out, newrp, InsetText::JustText);
+ out << html::EndTag("pre");
if (isInline) {
- out << "<br />\n";
- os << out.str();
+ out << html::CompTag("br");
+ // escaping will already have been done
+ os << XHTMLStream::NextRaw() << ods.str();
} else {
- out << "</div>";
+ out << html::EndTag("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;
+ def = ods.str() + '\n' + def;
}
return def;
}