From 14a045375e7ad1abdb037dd7c6c104964c8d25a8 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sat, 7 Nov 2015 20:28:35 +0300 Subject: Add a failing testcase for issue #440. --- tests/extensions/extra/tables.html | 15 +++++++++++++++ tests/extensions/extra/tables.txt | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html index 91337e5..783c205 100644 --- a/tests/extensions/extra/tables.html +++ b/tests/extensions/extra/tables.html @@ -235,4 +235,19 @@ Content Cell | Content Cell more words + +

A test for issue #440:

+ + + + + + + + + + + + +
foobar
foo(bar) and baz.
\ No newline at end of file diff --git a/tests/extensions/extra/tables.txt b/tests/extensions/extra/tables.txt index 1602d1f..c9ca70a 100644 --- a/tests/extensions/extra/tables.txt +++ b/tests/extensions/extra/tables.txt @@ -68,4 +68,10 @@ words |``` some | code ``` | more words words |```` some | code ```` | more words words |`` some ` | ` code `` | more words words |``` some ` | ` code ``` | more words -words |```` some ` | ` code ```` | more words \ No newline at end of file +words |```` some ` | ` code ```` | more words + +A test for issue #440: + +foo | bar +--- | --- +foo | (`bar`) and `baz`. \ No newline at end of file -- cgit v1.2.3 From b966709845116975709bbe7aec98eab6732e44df Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sat, 7 Nov 2015 20:32:49 +0300 Subject: Fix handling of characters after backtick in tables. Fixes #440. Thanks @jandecaluwe for the bug report. --- markdown/extensions/tables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py index 494aaeb..39c09a4 100644 --- a/markdown/extensions/tables.py +++ b/markdown/extensions/tables.py @@ -119,7 +119,7 @@ class TableProcessor(BlockProcessor): groups = match.groups() delim = groups[1] # the code block delimeter (ie 1 or more backticks) row_contents = groups[2] # the text contained inside the code block - i += match.start(4) # jump pointer to the beginning of the rest of the text (group #4) + i += match.start(4) - 1 # jump pointer to the beginning of the rest of the text (group #4) element = delim + row_contents + delim # reinstert backticks current += element i += 1 -- cgit v1.2.3