Remove invalid HTML (<a> without href or name) in badge template
Correct rendering of invisible badges