I do not think that HTL has such functionality to distinguish internal/external links. You will need to write something custom to handle case a use case. Take a look at this [1] to help you in creating this customization.
[1] https://wcm.io/handler/link/usage.html