You can achieve this also by using the on HOTLINK event and then echoing the line and halting the default text.
You probably want to use a regex match for catching URLs.

That said, this could be a desirable default function.