Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consecutive tables aren't captioned #13

Open
xpqz opened this issue Jun 13, 2024 · 0 comments
Open

Consecutive tables aren't captioned #13

xpqz opened this issue Jun 13, 2024 · 0 comments

Comments

@xpqz
Copy link

xpqz commented Jun 13, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant