]> granicus.if.org Git - multimarkdown/commitdiff
FIXED: Fix bug when no closing divider or newline at end of last table cell
authorFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 11 Feb 2017 13:41:12 +0000 (08:41 -0500)
committerFletcher T. Penney <fletcher@fletcherpenney.net>
Sat, 11 Feb 2017 13:41:12 +0000 (08:41 -0500)
src/html.c

index d147153028c7c4cf330de39b9f20262398b05784..3d900b90739bd7cb05ad07c2b507e5b862905b84 100644 (file)
@@ -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("</td>\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;