]> git.lyx.org Git - features.git/commitdiff
Fix display of code listings in XHTML.
authorRichard Heck <rgheck@lyx.org>
Sun, 31 Jul 2016 05:47:30 +0000 (01:47 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 31 Jul 2016 05:48:57 +0000 (01:48 -0400)
Fixes bug #8362.

(cherry picked from commit ab3a49973f8f948884186f13fe8fd07ecd453198)

lib/layouts/stdinsets.inc
src/insets/InsetListings.cpp
status.22x

index a40572f9a8d1c88888fbb19b69c57aa500f4dac3..7432b29069e54ce11b270044b150ef59ddea54c2 100644 (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
index 91125d8895796518c3fb89f179f56eb525f1bf62..207e98bacdc4a4ea92c1337697c3776dcd21c093 100644 (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");
index 8e4bfa117eef5380fe540f7fc4046ed2bcb67f7e..f01ead87ec7046908996e64103d1078459163c00 100644 (file)
@@ -93,6 +93,8 @@ What's new
 
 - Use scaling factor for export of images (bug 8742).
 
+- Fix display of listings (bug 8362).
+
 
 * TEX2LYX