mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Simple characters.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33937 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
30b18aec37
commit
5ef3c828b2
@ -201,6 +201,39 @@ void InsetMathChar::mathmlize(MathStream & ms) const
|
||||
}
|
||||
|
||||
|
||||
void InsetMathChar::htmlize(HtmlStream & ms) const
|
||||
{
|
||||
std::string entity;
|
||||
switch (char_) {
|
||||
case '<': entity = "<"; break;
|
||||
case '>': entity = ">"; break;
|
||||
case '&': entity = "&"; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
bool have_entity = entity.empty();
|
||||
|
||||
if (ms.inText() || have_entity) {
|
||||
if (have_entity)
|
||||
ms << from_ascii(entity);
|
||||
else
|
||||
ms.os().put(char_);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!entity.empty()) {
|
||||
ms << ' ' << from_ascii(entity) << ' ';
|
||||
return;
|
||||
}
|
||||
|
||||
char const * space =
|
||||
(isalpha(char_) || Encodings::isMathAlpha(char_))
|
||||
? "" : " ";
|
||||
// we don't use MTag and ETag because we do not want the spacing
|
||||
ms << space << char_type(char_) << space;
|
||||
}
|
||||
|
||||
|
||||
bool InsetMathChar::isRelOp() const
|
||||
{
|
||||
return char_ == '=' || char_ == '<' || char_ == '>';
|
||||
|
@ -42,6 +42,8 @@ public:
|
||||
void octave(OctaveStream & os) const;
|
||||
///
|
||||
void mathmlize(MathStream & ms) const;
|
||||
///
|
||||
void htmlize(HtmlStream & ms) const;
|
||||
/// identifies Charinsets
|
||||
InsetMathChar const * asCharInset() const { return this; }
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user