markupsafe

Safely add untrusted strings to HTML/XML markup.

Here are some articles that you may find helpful