code: def escape(html):
      
      from yacms.conf import settings
      from yacms.core import defaults
      if settings.RICHTEXT_FILTER_LEVEL == defaults.RICHTEXT_FILTER_LEVEL_NONE:
          return html
      tags = settings.RICHTEXT_ALLOWED_TAGS
      attrs = settings.RICHTEXT_ALLOWED_ATTRIBUTES
      styles = settings.RICHTEXT_ALLOWED_STYLES
      if settings.RICHTEXT_FILTER_LEVEL == defaults.RICHTEXT_FILTER_LEVEL_LOW:
          tags += LOW_FILTER_TAGS
          attrs += LOW_FILTER_ATTRS
      return clean(html, tags=tags, attributes=attrs, strip=True,
                   strip_comments=False, styles=styles)
docs: Escapes HTML according to the rules defined by the settings
      ``RICHTEXT_FILTER_LEVEL``, ``RICHTEXT_ALLOWED_TAGS``,
      ``RICHTEXT_ALLOWED_ATTRIBUTES``, ``RICHTEXT_ALLOWED_STYLES``.