From: Fletcher T. Penney Date: Sat, 11 Feb 2017 13:41:12 +0000 (-0500) Subject: FIXED: Fix bug when no closing divider or newline at end of last table cell X-Git-Tag: 0.3.0a^2~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abbb943e38770c88603b5cf927567750ba27399a;p=multimarkdown FIXED: Fix bug when no closing divider or newline at end of last table cell --- diff --git a/src/html.c b/src/html.c index d147153..3d900b9 100644 --- a/src/html.c +++ b/src/html.c @@ -1252,7 +1252,7 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t print(" style=\"text-align:center;\""); break; } - if (t->next->type == TABLE_DIVIDER) { + if (t->next && t->next->type == TABLE_DIVIDER) { if (t->next->len > 1) { printf(" colspan=\"%d\"", t->next->len); } @@ -1264,7 +1264,11 @@ void mmd_export_token_html(DString * out, const char * source, token * t, size_t } else { print("\n"); } - scratch->table_cell_count += t->next->len; + if (t->next) + scratch->table_cell_count += t->next->len; + else + scratch->table_cell_count++; + break; case TABLE_DIVIDER: break;