#include "TextClass.h"
#include "support/debug.h"
+#include "support/docstream.h"
#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/Translator.h"
params_.type = cmd.getArg(1);
else
string2params(to_utf8(cmd.argument()), params_);
- setLayout(cur.buffer()->params());
+ setLayout();
break;
}
}
-int InsetBox::xhtml(odocstream & os, OutputParams const & runparams) const
+docstring InsetBox::xhtml(odocstream &, OutputParams const & runparams) const
{
- // 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;
+ string style;
+ if (!params_.width.empty())
+ style += ("width: " + params_.width.asHTMLString() + ";");
+ if (!params_.height.empty())
+ style += ("height: " + params_.height.asHTMLString() + ";");
+
+ docstring retval = from_ascii("<div class='" + params_.type + "'");
+ if (!style.empty())
+ retval += from_ascii(" style='" + style + "'");
+ retval += ">\n";
+ odocstringstream os;
+ docstring defer = InsetText::xhtml(os, runparams);
+ retval += os.str();
+ retval += "</div>\n";
+ retval += defer + "\n";
+ return retval;
}