Skip to content

Commit

Permalink
More fixes of TABLECELLBOUNDARIES chain handling.
Browse files Browse the repository at this point in the history
Fixes #213.
  • Loading branch information
mity committed Jan 10, 2024
1 parent 821477b commit d775b51
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/md4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,6 @@ md_mark_chain(MD_CTX* ctx, int mark_index)
case _T('~'): return (mark->end - mark->beg == 1) ? &TILDE_OPENERS_1 : &TILDE_OPENERS_2;
case _T('!'):
case _T('['): return &BRACKET_OPENERS;
case _T('|'): return &TABLECELLBOUNDARIES;
default: return NULL;
}
}
Expand Down Expand Up @@ -4070,12 +4069,8 @@ md_analyze_inlines(MD_CTX* ctx, const MD_LINE* lines, int n_lines, int table_mod
ctx->unresolved_link_tail = -1;

if(table_mode) {
/* (2) Analyze table cell boundaries.
* Note we reset TABLECELLBOUNDARIES chain prior to the call md_analyze_marks(),
* not after, because caller may need it. */
/* (2) Analyze table cell boundaries. */
MD_ASSERT(n_lines == 1);
TABLECELLBOUNDARIES.head = -1;
TABLECELLBOUNDARIES.tail = -1;
ctx->n_table_cell_boundaries = 0;
md_analyze_marks(ctx, lines, n_lines, 0, ctx->n_marks, _T("|"));
return ret;
Expand Down Expand Up @@ -4554,6 +4549,9 @@ md_process_table_row(MD_CTX* ctx, MD_BLOCKTYPE cell_type, OFF beg, OFF end,
PTR_CHAIN.head = -1;
PTR_CHAIN.tail = -1;

TABLECELLBOUNDARIES.head = -1;
TABLECELLBOUNDARIES.tail = -1;

return ret;
}

Expand Down

0 comments on commit d775b51

Please sign in to comment.