Fix bug #7947 by using InsetLayout rather than hardcoding things.

This commit is contained in:
Richard Heck 2012-07-10 17:17:45 -04:00
parent 1b7d812e51
commit 7821022ca0

View File

@ -226,12 +226,13 @@ docstring InsetWrap::xhtml(XHTMLStream & xs, OutputParams const & rp) const
{ {
string const len = params_.width.asHTMLString(); string const len = params_.width.asHTMLString();
string const width = len.empty() ? "50%" : len; string const width = len.empty() ? "50%" : len;
string const attr = "class='wrap' style='width: " + width + ";'"; InsetLayout const & il = getLayout();
xs << html::StartTag("div", attr); string const tag = il.htmltag();
string const attr = il.htmlattr() + " style='width:" + width + ";'";
xs << html::StartTag(tag, attr);
docstring const deferred = docstring const deferred =
InsetText::insetAsXHTML(xs, rp, InsetText::WriteInnerTag); InsetText::insetAsXHTML(xs, rp, InsetText::WriteInnerTag);
if (!len.empty()) xs << html::EndTag(tag);
xs << html::EndTag("div");
return deferred; return deferred;
} }