Treat TABLECELLBOUNDARIES chain as special one. It's not an ordinary openers chain as (most of) the others, and md_rollback() must not touch it. Fixes #212.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
diff --git a/src/md4c.c b/src/md4c.c
index 41ed5b4..cb57b2f 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -192,7 +192,7 @@ struct MD_CTX_tag {
#define TILDE_OPENERS_2 (ctx->mark_chains[10])
#define BRACKET_OPENERS (ctx->mark_chains[11])
#define DOLLAR_OPENERS (ctx->mark_chains[12])
-#define OPENERS_CHAIN_FIRST 1
+#define OPENERS_CHAIN_FIRST 2 /* [0] and [1] are special. */
#define OPENERS_CHAIN_LAST 12
int n_table_cell_boundaries;
diff --git a/test/tables.txt b/test/tables.txt
index b220f66..cd62100 100644
--- a/test/tables.txt
+++ b/test/tables.txt
@@ -355,3 +355,25 @@ A | B
</thead>
</table>
````````````````````````````````
+
+
+### [Issue 212](https://github.com/mity/md4c/issues/212)
+
+```````````````````````````````` example
+x
+|-
+|[*x*]()
+.
+<table>
+<thead>
+<tr>
+<th>x</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td><a href=""><em>x</em></a></td>
+</tr>
+</tbody>
+</table>
+````````````````````````````````