diff --git a/c/tex_parser/tex_table.c b/c/tex_parser/tex_table.c index 2116de4..6c36796 100644 --- a/c/tex_parser/tex_table.c +++ b/c/tex_parser/tex_table.c @@ -213,6 +213,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str } else { where_stack[tex_level--] = IN_UNDEF; + i--; } break; @@ -243,9 +244,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str break; case IN_TAG_UNKNOWN: - if (isspace(c)) { - - } else if (c == '{' || c == '[') { // tag params + if (c == '{' || c == '[') { // tag params where_stack[++tex_level] = IN_TAGPARM; } else if (c == '\\') { // new tag @@ -258,6 +257,9 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str } else if (isspace(c)) { where_stack[++tex_level] = IN_SPACE; + } else if (c == '}') { + where_stack[tex_level--] = IN_UNDEF; + } else { error->code = (int)i; error->message = "unexpected symbol (IN_TAG_UNKNOWN)";