WordPress hook / filter to process link inside a post
<p>Is there a <strong>hook / filter to process the link being added into a WordPress post</strong> ?</p>

<p>My aim is to <strong>pre-process the link</strong> inserted in a post using the following button and <strong>shorten it using a third party API like bit.ly</strong></p>

<p><strong>I want to do this for both internal / external links.</strong> </p>

<p><a href="https://i.stack.imgur.com/c484G.png" rel="noreferrer"><img src="https://i.stack.imgur.com/c484G.png" alt="TinyMCE add link button"></a></p>

<p><strong>One solution that I an think of is to add an extra button to my editor</strong> that does this but I would prefer a hook / filter that does the job, that way it would be more clean and I will convert that into a custom plugin for my website (there by allowing my WordPress to be up-gradable).</p>

<p>I went through the WordPress docs and skimmed through the following hooks / filters which were of no use to me</p>

<ol>
<li><p><a href="https://developer.wordpress.org/reference/hooks/add_link/" rel="noreferrer">https://developer.wordpress.org/reference/hooks/add_link/</a></p></li>
<li><p><a href="https://developer.wordpress.org/reference/hooks/post_link/" rel="noreferrer">https://developer.wordpress.org/reference/hooks/post_link/</a></p></li>
<li><p>And most of the ones listed here
<a href="https://developer.wordpress.org/?s=link" rel="noreferrer">https://developer.wordpress.org/?s=link</a></p></li>
</ol>