From: Richard Heck Date: Sun, 31 Jul 2016 05:47:30 +0000 (-0400) Subject: Fix display of code listings in XHTML. X-Git-Tag: 2.2.2~86 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5fa071ec1eb76c54c009f365430a8a6950ba2432;p=features.git Fix display of code listings in XHTML. Fixes bug #8362. (cherry picked from commit ab3a49973f8f948884186f13fe8fd07ecd453198) --- diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index a40572f9a8..7432b29069 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -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 diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index 91125d8895..207e98bacd 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -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"); diff --git a/status.22x b/status.22x index 8e4bfa117e..f01ead87ec 100644 --- a/status.22x +++ b/status.22x @@ -93,6 +93,8 @@ What's new - Use scaling factor for export of images (bug 8742). +- Fix display of listings (bug 8362). + * TEX2LYX