Don't hardcode listings but use InsetLayout.

This commit is contained in:
Richard Heck 2012-07-15 15:06:29 -04:00
parent f623ded109
commit 99402cd09c
2 changed files with 10 additions and 2 deletions

View File

@ -230,6 +230,7 @@ InsetLayout Listings
FreeSpacing true
ForceLTR true
RefPrefix lst
HTMLTag pre
End
InsetLayout Branch

View File

@ -280,11 +280,18 @@ docstring InsetListings::xhtml(XHTMLStream & os, OutputParams const & rp) const
<< caption << html::EndTag("div");
}
out << html::StartTag("pre");
InsetLayout const & il = getLayout();
string const tag = il.htmltag();
string attr = "class ='listings";
string const lang = params().getParamValue("language");
if (!lang.empty())
attr += " " + lang;
attr += "'";
out << html::StartTag(tag, attr);
OutputParams newrp = rp;
newrp.html_disable_captions = true;
docstring def = InsetText::insetAsXHTML(out, newrp, InsetText::JustText);
out << html::EndTag("pre");
out << html::EndTag(tag);
if (isInline) {
out << html::CompTag("br");