HTML for math spaces.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33986 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2010-03-31 20:47:55 +00:00
parent f3711d8a65
commit da26079578
2 changed files with 36 additions and 0 deletions

View File

@ -207,6 +207,40 @@ void InsetMathSpace::mathmlize(MathStream & ms) const
}
void InsetMathSpace::htmlize(HtmlStream & ms) const
{
SpaceInfo const & si = space_info[space_];
switch (si.kind) {
case InsetSpaceParams::THIN:
ms << from_ascii("&thinsp;");
break;
case InsetSpaceParams::MEDIUM:
ms << from_ascii("&nbsp;");
break;
case InsetSpaceParams::THICK:
ms << from_ascii("&emsp;");
break;
case InsetSpaceParams::ENSKIP:
ms << from_ascii("&ensp;");
break;
case InsetSpaceParams::QUAD:
ms << from_ascii("&emsp;");
break;
case InsetSpaceParams::QQUAD:
ms << from_ascii("&emsp;&emsp;");
break;
case InsetSpaceParams::CUSTOM: {
string l = length_.asHTMLString();
ms << MTag("span", "width='" + l + "'")
<< from_ascii("&nbsp;") << ETag("span");
break;
}
default:
break;
}
}
void InsetMathSpace::normalize(NormalStream & os) const
{
os << "[space " << int(space_) << "] ";

View File

@ -53,6 +53,8 @@ public:
///
void mathmlize(MathStream & ms) const;
///
void htmlize(HtmlStream & ms) const;
///
void write(WriteStream & os) const;
/// generate something that will be understood by the Dialogs.
InsetSpaceParams params() const;