Search code examples
hyperlinkpandoc

Pandoc: automatically convert URLs into hyperlinks


Is there an option which automatically converts URLs into hyperlinks in Pandoc?

E.g.

http://www.test.com

should become

[http://www.test.com](http://www.test.com)

Or even cooler would be without the protocol:

[www.test.com](http://www.test.com)

Solution

  • Just surround them in <> : <http://www.test.com>

    echo "<http://example.com>" | pandoc
    <p><a href="http://example.com" class="uri">http://example.com</a></p>
    

    That will not work without the http:// though. See the documentation.