omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    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

    Editorial
    3
    6
    3452
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Niklas
      Niklas last edited by

      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

      1 Reply Last reply Reply Quote 0
      • omz
        omz last edited by

        Wouldn't that be the same as the workflow in this thread?

        1 Reply Last reply Reply Quote 1
        • Niklas
          Niklas last edited by

          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

          1 Reply Last reply Reply Quote 0
          • omz
            omz last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • aanchal
              aanchal Banned last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • Niklas
                Niklas last edited by

                Yes, that's exactly what I wanted. Thank you very much for your help! :-)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors