flattening contents of a-tags in DOM tree