Extract all URLs from links
Goal: Collect every link target in a document — handy for a broken-link checker or a quick inventory of external references.
Prerequisites: None.
Query
.link.url
$ mq '.link.url' README.md
Input
Check out [mq](https://mqlang.org) and [GitHub](https://github.com).
Output
https://mqlang.org
https://github.com
Notes
- Want the link’s visible text instead? Use
.link.valuein place of.link.url. (.link.titleis the separate, optional"title"attribute from[text](url "title")syntax — usually empty.) - Feed the URLs into a checker with
-F raw, or pipe toxargs curl -sfIoutside mq to validate them.