tomduck / pandoc-tablenos

A pandoc filter for numbering tables and table references.
GNU General Public License v3.0
108 stars 8 forks source link

Why is id in link before table instead of on table itself #11

Closed vincerubinetti closed 5 years ago

vincerubinetti commented 5 years ago

The output of tablenos seems to put the id/anchor to the table in a <a> tag preceding the table instead of in the <table> element itself. I was wondering what the reason is for that, and if there's a way to configure the plugin to remedy that.

I get output that resembles this:

<a name="tbl:bowling-scores"></a>
<table>
<caption><span>Table 1:</span> Bowling scores</caption>
<thead>
<tr class="header">
...
</tr>
</thead>
<tbody>
<tr class="odd">
...
</tr>
<tr class="even">
...
</tr>
<tr class="odd">
...
</tr>
</tbody>
</table>
tomduck commented 5 years ago

Hi, Vincent.

After looking into it, we have a similar problem here to what we found with figure ids in pandoc-fignos. Pandoc's table type is currently unattributed, so there is no way for me to pass id information on to pandoc. My workaround was to place an anchor immediately before the table.

Cheers, Tom

tomduck commented 5 years ago

I'm going to close this because it follows our earlier exchange, but please feel welcome to reopen it if there is more discussion to be had. --Tom