1 # -*- coding: utf-8 -*-
8 :copyright: 2008 by Armin Ronacher.
9 :license: BSD, see LICENSE for more details.
13 def escape(obj, attribute=False):
14 """HTML escape an object."""
15 if hasattr(obj, '__html__'):
18 .replace('&', '&') \
19 .replace('>', '>') \
22 s = s.replace('"', '"')