diff --git a/src/mathed/InsetMathSymbol.cpp b/src/mathed/InsetMathSymbol.cpp index a4a761171f..522793cedd 100644 --- a/src/mathed/InsetMathSymbol.cpp +++ b/src/mathed/InsetMathSymbol.cpp @@ -186,9 +186,8 @@ char const * MathMLtype(docstring const & s) void InsetMathSymbol::mathmlize(MathStream & os) const { - // FIXME To get this working properly, we need to do add the - // XML entity definitions to lib/symbols. And probably do more - // interesting things with MathMLtype + // FIXME We may need to do more interesting things + // with MathMLtype. char const * type = MathMLtype(sym_->extra); os << '<' << type << "> "; if (sym_->xmlname == "x") @@ -200,6 +199,23 @@ void InsetMathSymbol::mathmlize(MathStream & os) const } +void InsetMathSymbol::htmlize(HtmlStream & os) const +{ + // FIXME We may need to do more interesting things + // with MathMLtype. + char const * type = MathMLtype(sym_->extra); + bool op = (std::string(type) == "mo"); + + if (sym_->xmlname == "x") + // unknown so far + os << ' ' << name() << ' '; + else if (op) + os << ' ' << sym_->xmlname << ' '; + else + os << sym_->xmlname; +} + + void InsetMathSymbol::octave(OctaveStream & os) const { if (name() == "cdot") diff --git a/src/mathed/InsetMathSymbol.h b/src/mathed/InsetMathSymbol.h index 5382f72e85..59df8fb02c 100644 --- a/src/mathed/InsetMathSymbol.h +++ b/src/mathed/InsetMathSymbol.h @@ -63,6 +63,8 @@ public: /// void mathmlize(MathStream &) const; /// + void htmlize(HtmlStream &) const; + /// void octave(OctaveStream &) const; /// void write(WriteStream & os) const;