LUAfilter for pandoc (with crossref) that extracts a table’s label
I’m using pandoc (with the pandoc-crossref filter) to convert markdown documents to LATEX. But I want tables to be outputted as regular (floating) table environments rather than as (non-floating) longtables. I’ve written a LUA filter to do this, which is successful, except that it fails to extract the information about the table’s pandoc-crossref label. I need to extract this information so that I can include this label as part of the LATEX output (and thereby crossreference the table). Here’s a minimal example.