pander icon indicating copy to clipboard operation
pander copied to clipboard

Feature request: Use link references in tables

Open dhicks opened this issue 4 years ago • 0 comments

I've been struggling the last several days with a version of #336 : I have a table with one column that contains links attached to very short text, and it ends up ridiculously wide, like a third of the table width. The attachment table.md shows the first few rows of this table (generated with pandoc.table()).

With manually-generated markdown, one workaround is to use link references. The attachment table_ref.md shows how this works in practice. This allows the problem column to be much narrower, and the result has much nicer column widths when rendered to HTML by pandoc.

So one approach to addressing this problem in pander would be to automatically replace image and link targets with these link references. To ensure uniqueness, a hash function could be used to generate link labels from the targets, in much the same way services like bit.ly automatically generate shortlinks.

table.md table_ref.md

dhicks avatar Aug 17 '21 19:08 dhicks