Markdown tables: implement table_attributes extension.

When `table_attributes` is enabled (as it is by default for
pandoc's Markdown), attributes can be attached to a table by
including them at the end of the caption. Previously the writer
would emit an identifier in this position, but the reader didn't
handle it. Now arbitrary attributes are allowed, and they work in
both the reader and writer.

Closes #10884.

[API change]: Text.Pandoc.Extensions: Add `Ext_table_attributes`
constructor for `Extension`.
This commit is contained in:
John MacFarlane
2025-10-02 13:07:50 +02:00
parent 127e397a6d
commit e201e3370a
7 changed files with 49 additions and 14 deletions
+17
View File
@@ -0,0 +1,17 @@
```
% pandoc -f markdown -t markdown
header1 header2
--------- ---------
r1c1 r1c2
r2c1 r2c2
: mycaption {#myid .myclass key="value"}
^D
header1 header2
--------- ---------
r1c1 r1c2
r2c1 r2c2
: mycaption {#myid .myclass key="value"}
```
+1 -1
View File
@@ -15,4 +15,4 @@
Total 27,376,022 1,258,336
-------------------------------------------------------------------------------
: States belonging to the *Nordics.* {#nordics}
: States belonging to the *Nordics.* {#nordics source="wikipedia"}
+1 -1
View File
@@ -20,4 +20,4 @@
| 4100332 | Toyota, Hiroko |
+-----------------------------------------+-----------------------------------------+
: List of Students {#students}
: List of Students {#students source="mdn"}