don't apply urlize to @a@b (#2062)
This commit is contained in:
commit
7a41ddb915
@ -40,6 +40,7 @@ Unreleased
|
||||
- ``PackageLoader`` shows a clearer error message when the package does not
|
||||
contain the templates directory. :issue:`1705`
|
||||
- Improve annotations for methods returning copies. :pr:`1880`
|
||||
- ``urlize`` does not add ``mailto:`` to values like `@a@b`. :pr:`1870`
|
||||
|
||||
|
||||
Version 3.1.4
|
||||
|
||||
@ -333,6 +333,8 @@ def urlize(
|
||||
elif (
|
||||
"@" in middle
|
||||
and not middle.startswith("www.")
|
||||
# ignore values like `@a@b`
|
||||
and not middle.startswith("@")
|
||||
and ":" not in middle
|
||||
and _email_re.match(middle)
|
||||
):
|
||||
|
||||
@ -142,6 +142,14 @@ class TestEscapeUrlizeTarget:
|
||||
"http://example.org</a>"
|
||||
)
|
||||
|
||||
def test_urlize_mail_mastodon(self):
|
||||
fr = "nabijaczleweli@nabijaczleweli.xyz\n@eater@cijber.social\n"
|
||||
to = (
|
||||
'<a href="mailto:nabijaczleweli@nabijaczleweli.xyz">'
|
||||
"nabijaczleweli@nabijaczleweli.xyz</a>\n@eater@cijber.social\n"
|
||||
)
|
||||
assert urlize(fr) == to
|
||||
|
||||
|
||||
class TestLoremIpsum:
|
||||
def test_lorem_ipsum_markup(self):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user