From 04b823cac508c015be70cbc906975eab7177b7da Mon Sep 17 00:00:00 2001 From: Domingo Alvarez Duarte Date: Wed, 27 Dec 2017 10:31:48 +0100 Subject: [PATCH] Fix to parse table rows with escaped '\|' This is a fix to allow correctly parse tables with vertical bar escaped see bellow from https://github.com/mity/md4c : ``` example Column 1 | Column 2 ---------|--------- foo | bar baz | qux \| xyzzy quux | quuz .
Column 1Column 2
foobar
bazqux | xyzzy
quuxquuz
``` --- src/markdown.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markdown.c b/src/markdown.c index ea3cf232..36e05901 100644 --- a/src/markdown.c +++ b/src/markdown.c @@ -2011,7 +2011,7 @@ parse_table_row( cell_start = i; - while (i < size && data[i] != '|') + while (i < size && ((data[i] != '|') || ((i > 0) && (data[i-1] == '\\')))) i++; cell_end = i - 1;