diff --git a/zerver/lib/bugdown/__init__.py b/zerver/lib/bugdown/__init__.py index ca3958854b..c3758dad6e 100644 --- a/zerver/lib/bugdown/__init__.py +++ b/zerver/lib/bugdown/__init__.py @@ -613,7 +613,7 @@ class Bugdown(markdown.Extension): for k in ('image_link', 'image_reference', 'automail', 'autolink', 'link', 'reference', 'short_reference', 'escape', 'strong_em', 'emphasis', 'emphasis2', - 'strong'): + 'linebreak', 'linebreak2', 'strong'): del md.inlinePatterns[k] md.preprocessors.add("custom_text_notifications", AlertWordsNotificationProcessor(md), "_end") diff --git a/zerver/tests.py b/zerver/tests.py index bc9ac78192..9874634ed2 100644 --- a/zerver/tests.py +++ b/zerver/tests.py @@ -3196,6 +3196,15 @@ xxxxxxx

\n

xxxxxxx xxxxx xxxx xxxxx:
\nxxxxxx: xxx self.assertEqual(converted, '

Look at the new dropbox logo: https://www.dropbox.com/static/images/home_logo.png

\n
') + def test_nl2br(self): + msg = 'test\nbar' + converted = bugdown_convert(msg) + self.assertEqual(converted, '

test
\nbar

') + + msg = 'test ' + converted = bugdown_convert(msg) + self.assertEqual(converted, '

test

') + def test_inline_interesting_links(self): def make_link(url): return '%s' % (url, url, url)