]> git.lyx.org Git - features.git/commitdiff
Don't hardcode listings but use InsetLayout.
authorRichard Heck <rgheck@lyx.org>
Sun, 15 Jul 2012 19:06:29 +0000 (15:06 -0400)
committerRichard Heck <rgheck@lyx.org>
Fri, 8 Feb 2013 14:48:48 +0000 (09:48 -0500)
lib/layouts/stdinsets.inc
src/insets/InsetListings.cpp

index c38edbadf63555974735236c7073821840114e62..2f1beae008881105354bb6b105ff33cee29bab29 100644 (file)
@@ -230,6 +230,7 @@ InsetLayout Listings
        FreeSpacing           true
        ForceLTR              true
        RefPrefix             lst
+       HTMLTag               pre
 End
 
 InsetLayout Branch
index d05c946ea49df9188988c73325f608a0030a2626..4baaff0d470cf4e8c28c4785ace2513f036e698c 100644 (file)
@@ -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");