We wouldn't tolerate sexual harassment, etc., in the workplace or in civil society. I don't see why we wouldn't expect a basic level of decorum in respectable online communities.
But what we can do is strongly oppose any harassment. Clearly tell off anyone whe participates in harassment.
Of course, the leaders of any community should be a role model in not supporting harassment.
And people will know what's fair and when they're being bullied. The change has to work towards equality, not revenge and entrapping others.
Currently the exact opposite is happening: the changes are forced by small online groups, mostly associated with software development. Which bully others into submission.
You've probably noticed how in the real world, society is quite divided, with basic civil rights being questioned. This is what happens when people "win" in their little software bubbles.
Did female harassment get solved in society at large? No. You can't solve it in online communities, you're only building bubbles of false-safety which will pop once the pressure from the real world becomes high enough.
America in particular is under so much political and social tension that it's starting to show cracks and online lynch mobs are a part of the problem.