]> git.lyx.org Git - features.git/commitdiff
Fix bug #7948 by not hardcoding XHTML info for captions but instead
authorRichard Heck <rgheck@lyx.org>
Tue, 10 Jul 2012 21:44:21 +0000 (17:44 -0400)
committerRichard Heck <rgheck@lyx.org>
Fri, 8 Feb 2013 14:30:31 +0000 (09:30 -0500)
using InsetLayout.

lib/layouts/aastex.layout
lib/layouts/aguplus.inc
lib/layouts/apa.layout
lib/layouts/apa6.layout
lib/layouts/bicaption.module
lib/layouts/scrclass.inc
lib/layouts/stdinsets.inc
src/insets/InsetCaption.cpp

index 9b507bb65e637cc4e14a6bb03adb6df991751a17..7e34d3c830c0a54014eb21f5a65dd7842ef4bf06 100644 (file)
@@ -632,6 +632,7 @@ InsetLayout Caption:FigCaption
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-figcaption'"
 End
 
 
index 5b866f342f1808e2f3def3c411ce9cbfc3e3acb3..2a359305a22a526fadf343b28308295939d10df8 100644 (file)
@@ -215,6 +215,7 @@ InsetLayout Caption:Table
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-table'"
 End
 
 
index 374a048f6570adf905d5fc33622dbfedd7f3170b..68c3a0de123a54169b13b24278096767197fdf92 100644 (file)
@@ -263,6 +263,7 @@ InsetLayout Caption:Centered
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-centered'"
 End
 
 
index 9641621f1513c367fafda3cdd3a242970f5011b7..5fd0bcbcd0b66d56ac0c329d53f0662cffd47e78 100644 (file)
@@ -363,6 +363,7 @@ InsetLayout Caption:Centered
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-centered'"
 End
 
 
index fad79db73bb6d7755d50b6fd6dbbde2e14e766fd..122d9fc4f7b53cd9f02d90da1535bdd787db6393 100644 (file)
@@ -61,4 +61,5 @@ InsetLayout Caption:Bicaption
           margin: 1ex;
          }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-bicaption'"
 End
index f870eee9163b18bd7e1a6f0e457671938f96d247..471d9c0be2e8068b87ba991f50278341f6c967fe 100644 (file)
@@ -279,6 +279,7 @@ InsetLayout Caption:Above
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-above'"
 End
 
 
@@ -298,6 +299,7 @@ InsetLayout Caption:Below
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-below'"
 End
 
 
index 1054254fc31657dcb25576a6a46579c87f7c30f6..c38edbadf63555974735236c7073821840114e62 100644 (file)
@@ -486,6 +486,7 @@ InsetLayout Caption:Standard
                        margin: 1ex;
                }
        EndHTMLStyle
+       HTMLAttr "class='float-caption float-caption-standard'"
 End
 
 
index 550f9fe6e14c77842023d81edb370c939ff88b78..37913bc480ad79e2b169dcd78d77adfa81e2e881 100644 (file)
@@ -305,13 +305,18 @@ docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
 {
        if (rp.html_disable_captions)
                return docstring();
-       string attr = "class='float-caption";
-       if (!floattype_.empty())
-               attr += " float-caption-" + floattype_;
-       attr += "'";
-       xs << html::StartTag("div", attr);
+       InsetLayout const & il = getLayout();
+       string const tag = il.htmltag();
+       string attr = il.htmlattr();
+       if (!type_.empty()) {
+               string const our_class = "float-caption-" + type_;
+               size_t const loc = attr.find("class='");
+               if (loc != string::npos)
+                       attr.insert(loc + 1, our_class);
+       }
+       xs << html::StartTag(tag, attr);
        docstring def = getCaptionAsHTML(xs, rp);
-       xs << html::EndTag("div");
+       xs << html::EndTag(tag);
        return def;
 }