diff --git a/markdown/extensions/tables.py b/markdown/extensions/tables.py index 494aaeb3e..39c09a46a 100644 --- a/markdown/extensions/tables.py +++ b/markdown/extensions/tables.py @@ -119,7 +119,7 @@ def _split(self, row, marker): 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 diff --git a/tests/extensions/extra/tables.html b/tests/extensions/extra/tables.html index 91337e57d..783c20574 100644 --- a/tests/extensions/extra/tables.html +++ b/tests/extensions/extra/tables.html @@ -235,4 +235,19 @@

Table Tests

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 1602d1f3d..c9ca70a1a 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