Returns *content* with all paragraphs wrapped in `<p>` tags.

  If *hard_breaks* is set, line breaks are converted to `<br />` tags.

def wrap_paragraphs(content, hard_breaks=False):
  """
  Returns *content* with all paragraphs wrapped in `<p>` tags.

  If *hard_breaks* is set, line breaks are converted to `<br />` tags.

  """
  paras = filter(None, [para.strip() for para in content.split('\n\n')])
  paras = [build_paragraph(para, hard_breaks) for para in paras]
  return '\n'.join(paras)