yshavit / mdq

like jq but for Markdown: find specific elements in a md doc
Apache License 2.0
5 stars 0 forks source link

add link reference option for "no inlines" #176

Open yshavit opened 3 months ago

yshavit commented 3 months ago

Right now, we have three options for handling link definitions (including images):

  1. Keep as-is
  2. Always use inline
  3. Always use full reference style: [text][1]

In the last option, we do at least collapsed links ([text][]) and shortcut links ([text]) slightly differently, in that rather than just assigning them a number, we have the full-reference id be the expanded text:

This is pretty ugly and awkward. I should add an option (maybe have it be default? maybe have it be the only option) to keep collapsed and shortcut links as-is, or maybe canonicalize them to either collapsed or shortcut; or maybe just auto-assign a number to them. But basically, the current approach is pretty ugly, especially if the text is a bit longish.

I should also review the various markdown specs to see how portable collapsed/shortcut links are.

yshavit commented 3 months ago

It looks like: