view test/test_mailer.py @ 7561:91725f12b239

Support markdown2 2.4.10, 2.4.8- and exclude 2.4.9 Handle these changes to markdown2 version 2.4.9 broke links like (issue1)[issue1]: raise error if used Version 2.4.10 changed how filtering of schemes is done: adapt to new method Mail url's in markdown are formatted [label](mailto:user@something.com). The markdown format wrapper uses the plain text formatter to turn issue1 and user@something.com into markdown formatted strings to be htmlized by the markdown formatters. However when the plain text formatter saw (mailto:user@something.com) it made it (mailto:<user@something.com>). This is broken as the enamil address shouldn't have the angle brackets. By modifying the email pattern to include an optional mailto:, all three markdown formatters do the right thing and I don't end up with href="<user@something.com>" in the link.
author John Rouillard <rouilj@ieee.org>
date Sun, 23 Jul 2023 16:50:35 -0400
parents 95a366d46065
children
line wrap: on
line source

#-*- encoding: utf-8 -*-
import unittest

from roundup import mailer

class EncodingTestCase(unittest.TestCase):
    def testEncoding(self):
        a = lambda n, a, c, o: self.assertEqual(mailer.nice_sender_header(n,
            a, c), o)
        a('ascii', 'ascii@test.com', 'iso8859-1', 'ascii <ascii@test.com>')
        a(u'café', 'ascii@test.com', 'iso8859-1',
            '=?iso8859-1?q?caf=E9?= <ascii@test.com>')
        a(u'café', 'ascii@test.com', 'utf-8',
            '=?utf-8?b?Y2Fmw6k=?= <ascii@test.com>')
        a('as"ii', 'ascii@test.com', 'iso8859-1', '"as\\"ii" <ascii@test.com>')

# vim: set et sts=4 sw=4 :

Roundup Issue Tracker: http://roundup-tracker.org/