Fix display of code listings in XHTML.

Fixes bug #8362.

(cherry picked from commit ab3a49973f)
This commit is contained in:
Richard Heck 2016-07-31 01:47:30 -04:00
parent 1bcede451a
commit 5fa071ec1e
3 changed files with 18 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

@ -272,10 +272,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");
}
@ -371,6 +371,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");

View File

@ -93,6 +93,8 @@ What's new
- Use scaling factor for export of images (bug 8742).
- Fix display of listings (bug 8362).
* TEX2LYX