[LyX/master] Fix bug #13066

Richard Kimberly Heck rikiheck at lyx.org
Mon Jun 3 03:07:38 UTC 2024


commit 0c70f340c0fe33daa68b2a3eb4b3347fef1a9a95
Author: Richard Kimberly Heck <rikiheck at lyx.org>
Date:   Sun Jun 2 23:06:11 2024 -0400

    Fix bug #13066
    
    Patch from Lorenzo
---
 lib/layouts/stdinsets.inc    | 15 +--------------
 src/insets/InsetListings.cpp |  8 ++------
 2 files changed, 3 insertions(+), 20 deletions(-)

diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc
index 364b9b76e6..b0846947d1 100644
--- a/lib/layouts/stdinsets.inc
+++ b/lib/layouts/stdinsets.inc
@@ -375,20 +375,7 @@ InsetLayout Listings
 	NeedCProtect          true
 	RefPrefix             lst
 	EditExternal          true
-	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
+	HTMLTag               code
 	DocBookTag            programlisting
 End
 
diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp
index 24c8a21a63..89b71e7e4d 100644
--- a/src/insets/InsetListings.cpp
+++ b/src/insets/InsetListings.cpp
@@ -440,9 +440,7 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
 docstring InsetListings::xhtml(XMLStream & os, OutputParams const & rp) const
 {
 	bool const isInline = params().isInline();
-	if (isInline)
-		os << xml::CompTag("br");
-	else {
+	if (!isInline) {
 		os << xml::StartTag("div", "class='float-listings'");
 		docstring caption = getCaptionHTML(rp);
 		if (!caption.empty())
@@ -466,9 +464,7 @@ docstring InsetListings::xhtml(XMLStream & os, OutputParams const & rp) const
 	docstring def = InsetText::insetAsXHTML(os, newrp, InsetText::JustText);
 	os << xml::EndTag(tag);
 
-	if (isInline) {
-		os << xml::CompTag("br");
-	} else {
+	if (!isInline) {
 		if (!def.empty()) {
 			os << '\n' << def;
 		}


More information about the lyx-cvs mailing list