code: def filter_paragraphify(value):
      
      value = re.sub(r'\r\n|\r|\n', '\n', value)  # Normalize newlines
      paras = re.split('\n{2,}', value)
      paras = ['<p>{0}</p>'.format(p) for p in paras if len(p) > 0]
      return jinja2.Markup('\n\n'.join(paras))
docs: Convert text into one or more paragraphs, including <p> tags.
  
      Based on https://gist.github.com/cemk/1324543