else if (t.cat() == catOther) {
char_type c = t.character();
- if (isAsciiOrMathAlpha(c)
+ if (!Encodings::isUnicodeTextOnly(c)
|| mode_ & Parse::VERBATIM
|| !(mode_ & Parse::USETEXT)
|| mode == InsetMath::TEXT_MODE) {
MathAtom at = createInsetMath("text", buf);
at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
while (nextToken().cat() == catOther
- && !isAsciiOrMathAlpha(nextToken().character())) {
+ && Encodings::isUnicodeTextOnly(nextToken().character())) {
c = getToken().character();
at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
}
parse(ar, FLAG_OPTION, mode);
if (!ar.empty()) {
cell->push_back(MathAtom(new InsetMathRoot(buf)));
- cell->back().nucleus()->cell(0) = ar;
- parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode);
- } else {
+ cell->back().nucleus()->cell(1) = ar;
+ } else
cell->push_back(MathAtom(new InsetMathSqrt(buf)));
- parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
- }
+ parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
}
else if (t.cs() == "cancelto") {
cell->push_back(MathAtom(new InsetMathStackrel(buf, !ar.empty())));
if (!ar.empty())
cell->back().nucleus()->cell(2) = ar;
- parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode);
+ parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
}
else if (t.cs() == "xrightarrow" || t.cs() == "xleftarrow") {
docstring const halign = parse_verbatim_item();
cell->push_back(MathAtom(new InsetMathArray(buf, name,
InsetMathGrid::guessColumns(halign), 1, (char)valign[0], halign)));
- parse2(cell->back(), FLAG_END, mode, false);
+ parse2(cell->back(), FLAG_END, InsetMath::MATH_MODE, false);
}
else if (name == "tabular") {
putback();
}
+ else if (l->inset == "underset" || l->inset == "overset") {
+ cell->push_back(createInsetMath(t.cs(), buf));
+ parse(cell->back().nucleus()->cell(1), FLAG_ITEM, mode);
+ parse(cell->back().nucleus()->cell(0), FLAG_ITEM, mode);
+ }
+
else {
MathAtom at = createInsetMath(t.cs(), buf);
for (InsetMath::idx_type i = 0; i < at->nargs(); ++i)
Encodings::MATH_CMD | Encodings::TEXT_CMD,
is_combining, termination);
}
- if (c) {
+ if (c && buf->params().encoding().encodable(c)) {
if (termination) {
if (nextToken().cat() == catBegin) {
getToken();