Markdown URLs not linked in Print/PDF for iOS

I may be missing something, but it seems URLs in Markdown format [Title](URL) are not rendering as active links when the file is exported using Print, then the two-finger expand gesture to render the PDF. Strangely, URLs not enclosed with parentheses are active links. How can I export a markdown file to PDF that contains working (tappable) links? Thanks.

See if this action…

… along with this Shortcuts shortcut…

… get you what you’re after.

Thanks…I saw that combo in another post, but, unfortunately, it doesn’t work.

Okay. It works fine for me with “typical”(?) Markdown links that I’ve tried.

Could you maybe share an example Markdown link where the produced PDF doesn’t work for the link so I can try and reproduce it and see if I can figure out what’s going on?

Text File
https://www.dropbox.com/s/uffzi7q7ryn5ghw/test.txt?dl=0

Resulting PDF

It seems there is something odd with the formatting of my text files. After stripping out all other note text and leaving the two URLs, the two links in the PDF are active and tappable, but the “active link zone” is above the text.

I can see exactly that in your copy.

When I generate the PDF using the above, it looks like the hypertext targets are where you would expect and not displaced like yours were.

It might be worth checking how mine looks for you.

Download the PDF at https://d.pr/f/UR9VIq (Droplr).

The links in your PDF work as expected when viewed on my iPad. I will continue to investigate.

Do you have, for example, a stray space or tab character? Either in the link text or inside the round brackets that contain the URL?

A couple of tests for you.

First, amend the PDF action to trigger this shortcut.

Display Shared Text

It’ll display the HTML that Shortcuts is receiving.

Your example gave me this.

<html><style>body{font-family:'Avenir Next';font-size:100%;line-height: 3;}</style><body><p><a href="https://www.splendidtable.org/recipes/miso-marinated-salmon">Miso-Marinated Salmon</a></p>

<p><a href="https://crema.co/guides/french-press-coffee">Perfect French Press Coffee</a></p>
</body></html>

Do you get the same? Of not, that may be where your issue lies.

If you do, try this standalone shortcut. It foregoes the share sheet and processes the predefined HTML (as above) to generate the PDF.

PDF Test - HTML in Shortcuts

This should confirm for you if your issue lies with Shortcuts.

Hope that helps.

Thank you, both. I have no stray space or tab characters. The “Display Shared Text” script got me the same result as you, sylumer. The standalone shortcut did produce a PDF with active links, but the link targets were still offset (above the actual text). The issue is worse when including the rest of the text in the note. The link targets are offset by entire pages.

That indicates the issue is in your Shortcuts instance. Are you using the latest public release of the app on the latest iOS 12 release or some other combo?

Yes. Latest public release of the Shortcuts app and iOS 12.3.1. Same issue on my iPhone.

OK. A bit different for me. I’m on iOS 12.4 and Shortcuts 2.2.1. Maybe something there is the reason for the difference?

I updated to iOS 12.4 Public Beta 4 and, unfortunately, the issue remains. I am also using Shortcuts 2.2.1. Very strange.

For the benefit of others, my work-around is to use https://dillinger.io or https://stackedit.io.