Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
MD links from URL:s in document with rest of text intact
-
Hi!
Has anyone made a workflow that replaces all URL:s in a document with markdown links, with URL titles as titles, and leaves rest of document text untouched?
Best regards, Niklas Johansson
-
Wouldn't that be the same as the workflow in this thread?
-
Not quite. That one extracts all links from a text and makes it a nice list. I am looking for one that just replaces URL:s with MD links and leaves the rest of the text intact.
Best regards, Niklas
-
I see. Here's a simple Python script for replacing plain URLs with links:
http://www.editorial-workflows.com/workflow/5836041357361152/KGL46smq0Is
Note that this will only work properly if you don't have actual links in your document (because it would replace the link URLs as well, the regex would need to be a bit more complex to distinguish links from plain URLs).
Also, in some cases, retrieving the titles via Mechanize doesn't work (some sites don't like to be scraped). In that case, the title remains empty, and an error is logged to the console.
-
This post is deleted! -
Yes, that's exactly what I wanted. Thank you very much for your help! :-)