From 99402cd09c1db76bff84633d9780e0efa75bd6e3 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 15 Jul 2012 15:06:29 -0400 Subject: [PATCH] Don't hardcode listings but use InsetLayout. --- lib/layouts/stdinsets.inc | 1 + src/insets/InsetListings.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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"); -- 2.39.5