- // FIXME We also want to do something with the length info, etc,
- // presumably as "style='...'".
- os << from_ascii("<span class='" + params_.type + "'>\n");
- int ret = InsetText::xhtml(os, runparams);
- os << "</span>\n";
- return ret;
+ // construct attributes
+ string attrs = "class='" + params_.type + "'";
+ string style;
+ if (!params_.width.empty()) {
+ string w = params_.width.asHTMLString();
+ if (w != "100%")
+ style += ("width: " + params_.width.asHTMLString() + "; ");
+ }
+ // The special heights don't really mean anything for us.
+ if (!params_.height.empty() && params_.height_special == "none")
+ style += ("height: " + params_.height.asHTMLString() + "; ");
+ if (!style.empty())
+ attrs += " style='" + style + "'";
+
+ xs << html::StartTag("div", attrs);
+ XHTMLOptions const opts = InsetText::WriteLabel | InsetText::WriteInnerTag;
+ docstring defer = InsetText::insetAsXHTML(xs, runparams, opts);
+ xs << html::EndTag("div");
+ xs << defer;
+ return docstring();