Ok so initially I read this question in which people answered about HTML purifier, but saying that it took a day to configure. For me it was too long for a small project.
But I actually tried it and the default installation took me less than five minutes and work just fine. So, HTML purifier is the way to go, even if you don't have much time.