AAM rewriting HTML with duplicate domain name

It appears that the AAM is re-writing the following

to

Obviously the double domain name is causing the links to break.

Is this a bug?

By the way, links that start with a slash don’t get rewritten at all:

Note: please disregard the part about the link that didn’t get re-written - that seems to be unrelated. I tried to edit my original post but the forum won’t let me do that.