How render twig with xss

I have a page in html format.
I render this them:
{{ content | raw }}
but if user print i have xss attack

When you want to execute HTML code with Twig’s raw method, the code must be processed.

You can use tools like HTML Purifier.