Fix bug #7948 by not hardcoding XHTML info for captions but instead

using InsetLayout.
This commit is contained in:
Richard Heck 2012-07-10 17:44:21 -04:00
parent 7821022ca0
commit f623ded109
8 changed files with 19 additions and 6 deletions

View File

@ -632,6 +632,7 @@ InsetLayout Caption:FigCaption
margin: 1ex;
}
EndHTMLStyle
HTMLAttr "class='float-caption float-caption-figcaption'"
End

View File

@ -215,6 +215,7 @@ InsetLayout Caption:Table
margin: 1ex;
}
EndHTMLStyle
HTMLAttr "class='float-caption float-caption-table'"
End

View File

@ -263,6 +263,7 @@ InsetLayout Caption:Centered
margin: 1ex;
}
EndHTMLStyle
HTMLAttr "class='float-caption float-caption-centered'"
End

View File

@ -363,6 +363,7 @@ InsetLayout Caption:Centered
margin: 1ex;
}
EndHTMLStyle
HTMLAttr "class='float-caption float-caption-centered'"
End

View File

@ -61,4 +61,5 @@ InsetLayout Caption:Bicaption
margin: 1ex;
}
EndHTMLStyle
HTMLAttr "class='float-caption float-caption-bicaption'"
End

View 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

View File

@ -486,6 +486,7 @@ InsetLayout Caption:Standard
margin: 1ex;
}
EndHTMLStyle
HTMLAttr "class='float-caption float-caption-standard'"
End

View 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;
}