Skip to content

Consecutive tables aren't captioned #13

Description

@xpqz

If you have multiple tables in succession without anything between, every other table is uncaptioned. To reproduce:

import markdown
from caption import CaptionExtension, TableCaptionExtension

data="""
# Consecutive tables

Table: First

| A | B |
|---|---|
| a | b |

Table: Second

| C | D |
|---|---|
| c | d |
"""

print(markdown.markdown(data, extensions=[
    'tables',
    CaptionExtension(),
    TableCaptionExtension(caption_top=False),
]))

which leaves the second table uncaptioned:

<h1>Consecutive tables</h1>
<table id="_table-1">
<caption style="caption-side:bottom"><span>Table&nbsp;1:</span> First</caption>
<thead>
<tr>
<th>A</th>
<th>B</th>
</tr>
</thead>
<tbody>
<tr>
<td>a</td>
<td>b</td>
</tr>
</tbody>
</table>
<p>Table: Second</p>
<table>
<thead>
<tr>
<th>C</th>
<th>D</th>
</tr>
</thead>
<tbody>
<tr>
<td>c</td>
<td>d</td>
</tr>
</tbody>
</table>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions