more intelligent tag href parsing