HRef Implementation (imported from BitBucket repo).