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

"Bad reference" - syntax doesn't work on recent pandoc releases #107

Open
dmitryperets opened this issue Feb 5, 2024 · 1 comment
Open

Comments

@dmitryperets
Copy link

dmitryperets commented Feb 5, 2024

Using pandoc 3.1 (after successfully applying the regex fix from #105). While other filters from the pandoc-xnos family started working, pandoc-fignos is still broken.

Here is a simple example:

Keys    Values
-----   -------
Key1    Value1
Key2    Value2

Table: Silly Table {#tbl:silly}

![Figure](images/test.png){#fig:strange}

This table is +@tbl:silly.

This figure is +@fig:strange.

You can see here one table (using pandoc-tablenos) and one figure (using pandoc-fignos).
Both worked fine with pandoc 2.x.
But now only the table numbering works, not the figure numbering:

% pandoc test.md --filter pandoc-xnos -o test.html

pandoc-fignos: Bad reference: @fig:strange.

Output:

<div id="tbl:silly" class="tablenos">
<table id="tbl:silly">
<caption><span>Table 1:</span> Silly Table </caption>
<thead>
<tr class="header">
<th style="text-align: left;">Keys</th>
<th style="text-align: left;">Values</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Key1</td>
<td style="text-align: left;">Value1</td>
</tr>
<tr class="even">
<td style="text-align: left;">Key2</td>
<td style="text-align: left;">Value2</td>
</tr>
</tbody>
</table>
</div>
<figure id="fig:strange">
<img src="images/test.png" title="fig:" alt="Figure" />
<figcaption aria-hidden="true">Figure</figcaption>
</figure>
<p>This table is table <a href="#tbl:silly">1</a>.</p>
<p>This figure is fig. ??.</p>
@dmitryperets
Copy link
Author

Looking deeper, looks like Pandoc 3.x has introduced some significant changes to the AST, specifically adding a new object type "Figure": jgm/pandoc#3177, jgm/pandoc#7184

So no wonder that pandoc-fignos doesn't handle it correctly. The only question is who can update it now =)

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