From: Richard Heck Date: Sun, 15 Jul 2012 19:06:29 +0000 (-0400) Subject: Don't hardcode listings but use InsetLayout. X-Git-Tag: 2.1.0beta1~776 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=99402cd09c1db76bff84633d9780e0efa75bd6e3;p=features.git Don't hardcode listings but use InsetLayout. --- diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index c38edbadf6..2f1beae008 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -230,6 +230,7 @@ InsetLayout Listings FreeSpacing true ForceLTR true RefPrefix lst + HTMLTag pre End InsetLayout Branch diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index d05c946ea4..4baaff0d47 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -280,11 +280,18 @@ docstring InsetListings::xhtml(XHTMLStream & os, OutputParams const & rp) const << caption << html::EndTag("div"); } - out << html::StartTag("pre"); + InsetLayout const & il = getLayout(); + string const tag = il.htmltag(); + string attr = "class ='listings"; + string const lang = params().getParamValue("language"); + if (!lang.empty()) + attr += " " + lang; + attr += "'"; + out << html::StartTag(tag, attr); OutputParams newrp = rp; newrp.html_disable_captions = true; docstring def = InsetText::insetAsXHTML(out, newrp, InsetText::JustText); - out << html::EndTag("pre"); + out << html::EndTag(tag); if (isInline) { out << html::CompTag("br");