A pandoc filter that adds the capability of specifying table attributes in table captions in Pandoc's Markdown.
Simply append attributes to table captions like so:
Table: Table caption. {#id .class key=val}
FirstCol SecondCol
--------- ----------
FirstCell SecondCell
The attributes specified in the table caption will then be added to pandoc's AST and used by pandoc's writers (the HTML writer utilises table attributes, but I haven't tested this with any of the other writers yet).
Table attributes must appear at the end of the table caption.
The current implementation of pandoc-table-attr does not allow inline elements to be used in keyvalues if they would be parsed by pandoc as inline formatting, inline math, inline code blocks (Extension: backtick_code_blocks), generic raw attributes, inline links, or citations. Therefore, the following will not work:
Table: Table caption. {#id .class key="*val*"}
Pandoc will parse *val* as emphasized text, instead of literal asterisks. However, it is possible to use backslash escapes as a workaround:
Table: Table caption. {#id .class key="\*val\*"}