1. nabilt
  2. WebHelpers


Mike Orr  committed 50557c3

format_paragraphs(None) returns "" rather than "<p></p>".

  • Participants
  • Parent commits f9f2d86
  • Branches trunk

Comments (0)

Files changed (2)

File tests/test_converters.py

View file
  • Ignore whitespace
     eq_(u"<p>A paragraph\n With a newline</p>", format_paragraphs("A paragraph\n With a newline"))
 def test_format_paragraphs7():
-    eq_(u"<p></p>", format_paragraphs(None))
+    eq_(u"", format_paragraphs(None))

File webhelpers/html/converters.py

View file
  • Ignore whitespace
         If true, add <br />  before each single line break
     if text is None:
-        text = literal("")
+        return literal("")
     text = _universal_newline_rx.sub("\n", text)
     paragraphs = _paragraph_rx.split(text)
     for i, para in enumerate(paragraphs):