Fix display of code listings in XHTML.

Fixes bug #8362.
This commit is contained in:
Richard Heck 2016-07-31 01:47:30 -04:00
parent 1840e2dbaf
commit ab3a49973f
2 changed files with 16 additions and 2 deletions

View File

@ -313,6 +313,19 @@ InsetLayout Listings
ForceLTR true
RefPrefix lst
HTMLTag pre
HTMLStyle
div.float-listings {
border: 2px solid black;
padding: 1ex;
margin: 1ex;
}
div.listings-caption {
text-align: center;
border: 2px solid black;
padding: 1ex;
margin: 1ex;
}
EndHTMLStyle
End
InsetLayout Branch

View File

@ -273,10 +273,10 @@ docstring InsetListings::xhtml(XHTMLStream & os, OutputParams const & rp) const
if (isInline)
out << html::CompTag("br");
else {
out << html::StartTag("div", "class='float float-listings'");
out << html::StartTag("div", "class='float-listings'");
docstring caption = getCaptionHTML(rp);
if (!caption.empty())
out << html::StartTag("div", "class='float-caption'")
out << html::StartTag("div", "class='listings-caption'")
<< XHTMLStream::ESCAPE_NONE
<< caption << html::EndTag("div");
}
@ -372,6 +372,7 @@ docstring const InsetListings::buttonLabel(BufferView const & bv) const
void InsetListings::validate(LaTeXFeatures & features) const
{
features.require("listings");
features.useInsetLayout(getLayout());
string param_string = params().params();
if (param_string.find("\\color") != string::npos)
features.require("color");