Closed max-arnold closed 2 months ago
Sorry, I think I may have misunderstood your original worry about this.
I thought you were objecting to the empty <a>..</a>
. But this would not have the effect of making http://example.com
a clickable link. If that is happening, it is not because of the HTML pandoc is generating.
<span id="cb1-1">
<a href="#cb1-1" aria-hidden="true" tabindex="-1">
</a>
http://example.com
</span>
won't create a link on http://example.com
, which is outside of the <a>
element.
Are you sure you don't have some JavaScript thing running that adds autolinks in HTML?
Apparently I'm dumb today... It was macOS Preview app that made all these links in the PDF file clickable 🤦♂️ And when I went to debug this, I noticed these <a>
tags but missed the fact that they are empty.
I'm really sorry for wasting your time. Thank you for pointing me in the right direction!
It would be nice to disable autolinks in fenced
djangotemplate
(and other languages) code blocks. Right now it is not the case:I'm converting a markdown file with some code blocks to pdf (via weasyprint), and in the resulting snippets links are hoverable and clickable. It doesn't make sense in my scenario because the links are pointing either to localhost or example.com subdomains, or just http://x.x.x.x.
My expectation was that using
--from markdown-autolink_bare_uris
should affect the whole document, but apparently it doesn't work for fenced code blocks (maybe inline code as well?). Not sure how to fix that in a backward compatible way though... Maybe something like this:Or maybe define another extension that is enabled by default but can be disabled via
--from markdown-autolink_fenced_bare_uris
.Based on https://github.com/jgm/pandoc/discussions/10219