It is not about you
When other people are hurt, fear has captured their mind. That fear can produce anger, self-pitty, depression, judgmental behavior and other states of mind. Depending on the severity, people who are hurt take actions they usually later regret. Their judgment is clouded with these emotions and they stop being rational. In severe cases, they attack you. Usually verbal attack is the simplest form of an attack. Especially in written form when they feel safe and not threatend (think about all the internet trolls for example). They are hurt and the way they feel better about themself is to get the fear out in form of an attack so they can feel better for themself. Little they know, that anger produces even more anger and they are by this behaviour creating new version of themself that is even more sad, more insecure and looks even more stupid in front of their internal judge and others. Sometimes we can get absorbed into their world thinking that it is about us! This is so typical for our mind. That the attack, reaction, nasty behaviour is about us. About person who is being attacked, yet it is totally the opposite. Their behavior is completely outside of our control and therefore we should not spend a single minute in their circle of fear and most importantly, we should not take it at all personally.
It is hard to realize that sometimes immediately because once we are attacked we want to go immediately into "fight or flight" mode. This also applies to mild cases such as nasty shop assistant that is having a bad day and is rude to you, annoying insecure colleague that is trying to feel better for himself/herself by verbally attacking others or making fun of them in an inappropriate way or random stranger that just picked you in the crowd and needs to get the steam out. All these occurrences are actually not a personal attack at you, but a manifestation of the persons fears. If you think about it this way, any fight you will be dragged into will become much easier for you to handle with ease because you can really only witness it from the position of the observer and not be personally dragged into the fight. Practice it next time you feel offended, it over time it will become very deliberate feeling.