From: Richard Kimberly Heck Date: Mon, 3 Jun 2024 03:06:11 +0000 (-0400) Subject: Fix bug #13066 X-Git-Tag: 2.4.1~61 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=63b23ce288919e86eabcdfb4cfd498d26fdfc96a;p=lyx.git Fix bug #13066 Patch from Lorenzo (cherry picked from commit 0c70f340c0fe33daa68b2a3eb4b3347fef1a9a95) --- diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index 764fbff3f2..2a8afacad3 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 8268cebd68..b022acad5e 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; }