correctly handle semicolon in tag values