While this works elegantly for links that are made manually, by linking a word to https://website, it doesn’t seem catch links that are automatically generated by Discourse’s parser. In other words:
This works: Google
But this does not: Google.com
Can the script be improved to also catch the automatically generated links?