Rewrite the domain's on links that have markup inside the href or image tag.

@mpetrovic can you take a look?