diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index 25552d5aa8..ad2084f5bb 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -24,6 +24,7 @@
#include "LaTeXFeatures.h"
#include "Lexer.h"
#include "MetricsInfo.h"
+#include "output_xhtml.h"
#include "TextClass.h"
#include "support/debug.h"
@@ -478,24 +479,24 @@ int InsetBox::docbook(odocstream & os, OutputParams const & runparams) const
}
-docstring InsetBox::xhtml(odocstream &, OutputParams const & runparams) const
+docstring InsetBox::xhtml(XHTMLStream & xs, OutputParams const & runparams) const
{
+ // construct attributes
+ string attrs = "class='" + params_.type + "'";
string style;
if (!params_.width.empty())
style += ("width: " + params_.width.asHTMLString() + ";");
if (!params_.height.empty())
style += ("height: " + params_.height.asHTMLString() + ";");
-
- docstring retval = from_ascii("
\n";
- odocstringstream os;
- docstring defer = InsetText::xhtml(os, runparams);
- retval += os.str();
- retval += "
\n";
- retval += defer + "\n";
- return retval;
+ attrs += " style='" + style + "'";
+
+ xs << StartTag("div", attrs);
+ XHTMLOptions const opts = InsetText::WriteLabel | InsetText::WriteInnerTag;
+ docstring defer = InsetText::insetAsXHTML(xs, runparams, opts);
+ xs << EndTag("div");
+ xs << defer;
+ return docstring();
}
diff --git a/src/insets/InsetBox.h b/src/insets/InsetBox.h
index 1a45b04d8f..83ba43403e 100644
--- a/src/insets/InsetBox.h
+++ b/src/insets/InsetBox.h
@@ -117,7 +117,7 @@ private:
///
int docbook(odocstream &, OutputParams const &) const;
///
- docstring xhtml(odocstream &, OutputParams const &) const;
+ docstring xhtml(XHTMLStream &, OutputParams const &) const;
///
void validate(LaTeXFeatures &) const;
///
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 1d57c843a9..ccdc9f04ac 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -889,4 +889,9 @@ docstring InsetText::getCaptionHTML(OutputParams const & runparams) const
}
+InsetText::XHTMLOptions operator|(InsetText::XHTMLOptions a1, InsetText::XHTMLOptions a2)
+{
+ return static_cast((int)a1 | (int)a2);
+}
+
} // namespace lyx
diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h
index fb1fb0a6ba..421870b0e6 100644
--- a/src/insets/InsetText.h
+++ b/src/insets/InsetText.h
@@ -222,6 +222,9 @@ private:
mutable Text text_;
};
+
+InsetText::XHTMLOptions operator|(InsetText::XHTMLOptions a1, InsetText::XHTMLOptions a2);
+
} // namespace lyx
#endif