mirror of https://github.com/zulip/zulip.git
bugdown: Disable linebreaks from two spaces at end-of-line.
Arguably the nl2br extension should be doing this for us. Given that we're using nl2br, the "two spaces at the end of a line makes a line break" rule doesn't make any sense (since every newline leads to a linebreak), so we disable it. (imported from commit 5ffa2ac8a825642ad31e085c532091e076665710)
This commit is contained in:
parent
db71931dab
commit
b340add1aa
|
@ -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")
|
||||
|
|
|
@ -3196,6 +3196,15 @@ xxxxxxx</strong></p>\n<p>xxxxxxx xxxxx xxxx xxxxx:<br>\n<code>xxxxxx</code>: xxx
|
|||
|
||||
self.assertEqual(converted, '<p>Look at the new dropbox logo: <a href="https://www.dropbox.com/static/images/home_logo.png" target="_blank" title="https://www.dropbox.com/static/images/home_logo.png">https://www.dropbox.com/static/images/home_logo.png</a></p>\n<div class="message_inline_image"><a href="https://www.dropbox.com/static/images/home_logo.png" target="_blank" title="https://www.dropbox.com/static/images/home_logo.png"><img src="https://www.dropbox.com/static/images/home_logo.png"></a></div>')
|
||||
|
||||
def test_nl2br(self):
|
||||
msg = 'test\nbar'
|
||||
converted = bugdown_convert(msg)
|
||||
self.assertEqual(converted, '<p>test<br>\nbar</p>')
|
||||
|
||||
msg = 'test '
|
||||
converted = bugdown_convert(msg)
|
||||
self.assertEqual(converted, '<p>test </p>')
|
||||
|
||||
def test_inline_interesting_links(self):
|
||||
def make_link(url):
|
||||
return '<a href="%s" target="_blank" title="%s">%s</a>' % (url, url, url)
|
||||
|
|
Loading…
Reference in New Issue