I have been assigned with the task of developing a website where users can submit posts similar to a discussion forum. I want to incorporate basic text formatting options like bold, italic, and external links. While there are many JavaScript text editor components available for this purpose, I am concerned about potential security risks such as users inputting malicious code (such as embedded JavaScript). Is there a solution or method that would allow me to implement these features while also ensuring the security of my site?