mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 05:55:34 +00:00
Fix bug #7948 by not hardcoding XHTML info for captions but instead
using InsetLayout.
This commit is contained in:
parent
7821022ca0
commit
f623ded109
@ -632,6 +632,7 @@ InsetLayout Caption:FigCaption
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-figcaption'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
@ -215,6 +215,7 @@ InsetLayout Caption:Table
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-table'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
@ -263,6 +263,7 @@ InsetLayout Caption:Centered
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-centered'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
@ -363,6 +363,7 @@ InsetLayout Caption:Centered
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-centered'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,4 +61,5 @@ InsetLayout Caption:Bicaption
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-bicaption'"
|
||||||
End
|
End
|
||||||
|
@ -279,6 +279,7 @@ InsetLayout Caption:Above
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-above'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
@ -298,6 +299,7 @@ InsetLayout Caption:Below
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-below'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
@ -486,6 +486,7 @@ InsetLayout Caption:Standard
|
|||||||
margin: 1ex;
|
margin: 1ex;
|
||||||
}
|
}
|
||||||
EndHTMLStyle
|
EndHTMLStyle
|
||||||
|
HTMLAttr "class='float-caption float-caption-standard'"
|
||||||
End
|
End
|
||||||
|
|
||||||
|
|
||||||
|
@ -305,13 +305,18 @@ docstring InsetCaption::xhtml(XHTMLStream & xs, OutputParams const & rp) const
|
|||||||
{
|
{
|
||||||
if (rp.html_disable_captions)
|
if (rp.html_disable_captions)
|
||||||
return docstring();
|
return docstring();
|
||||||
string attr = "class='float-caption";
|
InsetLayout const & il = getLayout();
|
||||||
if (!floattype_.empty())
|
string const tag = il.htmltag();
|
||||||
attr += " float-caption-" + floattype_;
|
string attr = il.htmlattr();
|
||||||
attr += "'";
|
if (!type_.empty()) {
|
||||||
xs << html::StartTag("div", attr);
|
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);
|
docstring def = getCaptionAsHTML(xs, rp);
|
||||||
xs << html::EndTag("div");
|
xs << html::EndTag(tag);
|
||||||
return def;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user