I'm personally convinced that protests are worthless for changing people's hearts and minds, hence I question the wisdom of attending one whether it's peaceful or not. But if I was to attend a protest, and it turned violent--even 5% violent--I'd be hightailing it out of there. Violence of any kind is a recipe for chaos.
Nobody knows exactly who are the ones perpetrating the violence, inciting the violence, cheering on the violence, trying to stop the violence, obstructing efforts to stop the violence, simply watching the violence, and so forth. If I'm participating in the protest, then I'm a part of a mob whether I like it or not. I've "inherited", in a sense, a share of the collective actions of the mob, even if those actions don't sync with my intentions.
Hence if I get arrested, or tear gassed, or mistakenly attacked by my own side, despite having done nothing myself, I'm nevertheless deserving of the punishment. I've put myself in a situation I saw was becoming chaotic and hostile, and I took no steps to extricate myself. In some cases I'd go even further to say: I put myself in a situation that I reasonably ought to have known would become chaotic and hostile, and I deserve what I get even if I do eventually take steps to extricate myself.
Consequently, if these tougher punishments for looting and rioting make people more leery about participating in protests that predictably elicit this kind of behaviour--even if only from a guilty minority--I don't see this as a bad thing. If you want the strength and protection of the mob, you accept responsibility for the actions of the mob. If you can't stomach that, find another way to address the problem.