def normalize_text_for_edit(user, text, rich_text, escape_html=True):
 if (text is None):
  return u''
 if ((not rich_text) and is_rich_text_default_for_user(user)):
  text = djblets_markdown.markdown_escape(text)
 if escape_html:
  text = escape(text)
 return text

def normalize_text_for_edit ( user , text , rich_text , escape_html = True ) : if ( text is None ) : return u'' if ( ( not rich_text ) and is_rich_text_default_for_user ( user ) ) : text = djblets_markdown . markdown_escape ( text ) if escape_html : text = escape ( text ) return text
normalizes text .