Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion markdown/extensions/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions tests/extensions/extra/tables.html
Original file line number Diff line number Diff line change
Expand Up @@ -235,4 +235,19 @@ <h2>Table Tests</h2>
<td>more words</td>
</tr>
</tbody>
</table>
<p>A test for issue #440:</p>
<table>
<thead>
<tr>
<th>foo</th>
<th>bar</th>
</tr>
</thead>
<tbody>
<tr>
<td>foo</td>
<td>(<code>bar</code>) and <code>baz</code>.</td>
</tr>
</tbody>
</table>
8 changes: 7 additions & 1 deletion tests/extensions/extra/tables.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
words |```` some ` | ` code ```` | more words

A test for issue #440:

foo | bar
--- | ---
foo | (`bar`) and `baz`.