void InsetMathBox::mathmlize(MathStream & ms) const
{
- SetMode textmode(ms, true, from_ascii("class='mathbox'"));
+ SetMode textmode(ms, true, "class='mathbox'");
ms << cell(0);
}
void InsetMathFBox::mathmlize(MathStream & ms) const
{
- SetMode textmode(ms, true, from_ascii("class='fbox'"));
+ SetMode textmode(ms, true, "class='fbox'");
ms << cell(0);
}
{
// FIXME We could do something with the other arguments.
std::string const cssclass = framebox_ ? "framebox" : "makebox";
- SetMode textmode(ms, true, from_ascii("class='" + cssclass + "'"));
+ SetMode textmode(ms, true, "class='" + cssclass + "'");
ms << cell(2);
}
void InsetMathBoxed::mathmlize(MathStream & ms) const
{
- SetMode mathmode(ms, false, from_ascii("class='boxed'"));
+ SetMode mathmode(ms, false, "class='boxed'");
ms << cell(0);
}
SetMode::SetMode(MathStream & os, bool text)
: os_(os), opened_(false)
{
- init(text, from_ascii(""));
+ init(text, "");
}
-SetMode::SetMode(MathStream & os, bool text, docstring attrs)
+SetMode::SetMode(MathStream & os, bool text, string const & attrs)
: os_(os), opened_(false)
{
init(text, attrs);
}
-void SetMode::init(bool text, docstring attrs)
+void SetMode::init(bool text, string const & attrs)
{
was_text_ = os_.inText();
if (was_text_)
os_.setTextMode();
os_ << "<mtext";
if (!attrs.empty())
- os_ << " " << attrs;
+ os_ << " " << from_utf8(attrs);
os_ << ">";
opened_ = true;
} else {
if (!attrs.empty()) {
- os_ << "<mstyle " << attrs << ">";
+ os_ << "<mstyle " << from_utf8(attrs) << ">";
opened_ = true;
}
os_.setMathMode();
SetHTMLMode::SetHTMLMode(HtmlStream & os, bool text)
: os_(os), opened_(false)
{
- was_text_ = os_.inText();
- if (text)
- os_.setTextMode();
- else
- os_.setMathMode();
+ init(text, "");
}
SetHTMLMode::SetHTMLMode(HtmlStream & os, bool text, string attrs)
: os_(os), opened_(true)
+{
+ init(text, attrs);
+}
+
+
+void SetHTMLMode::init(bool text, string const & attrs)
{
was_text_ = os_.inText();
if (text) {
os_.setTextMode();
- os_ << MTag("span", attrs);
+ if (attrs.empty())
+ os_ << MTag("span");
+ else
+ os_ << MTag("span", attrs);
+ opened_ = true;
} else
os_.setMathMode();
}
class SetMode {
public:
///
- explicit SetMode(MathStream & os, bool text, docstring attrs);
+ explicit SetMode(MathStream & os, bool text, std::string const & attrs);
///
explicit SetMode(MathStream & os, bool text);
///
~SetMode();
private:
///
- void init(bool, docstring);
+ void init(bool, std::string const &);
///
MathStream & os_;
///
///
~SetHTMLMode();
private:
+ ///
+ void init(bool, std::string const &);
///
HtmlStream & os_;
///