diff --git a/django/utils/html.py b/django/utils/html.py
index ff3bc60021..75eff0083d 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -15,8 +15,8 @@ from .html_parser import HTMLParser, HTMLParseError
# Configuration for urlize() function.
-TRAILING_PUNCTUATION = ['.', ',', ':', ';', '.)']
-WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('[', ']'), ('<', '>')]
+TRAILING_PUNCTUATION = ['.', ',', ':', ';', '.)', '"', '\'']
+WRAPPING_PUNCTUATION = [('(', ')'), ('<', '>'), ('[', ']'), ('<', '>'), ('"', '"'), ('\'', '\'')]
# List of possible strings used for bullets in bulleted lists.
DOTS = ['·', '*', '\u2022', '', '•', '•']
diff --git a/tests/defaultfilters/tests.py b/tests/defaultfilters/tests.py
index 6f84c14b06..b1e0f5df96 100644
--- a/tests/defaultfilters/tests.py
+++ b/tests/defaultfilters/tests.py
@@ -324,6 +324,24 @@ class DefaultFiltersTests(TestCase):
self.assertEqual(urlize('http://[2001:db8:cafe::2]/api/9'),
'http://[2001:db8:cafe::2]/api/9')
+ # Check urlize correctly include quotation marks in links - #20364
+ self.assertEqual(urlize('before "hi@example.com" afterwards'),
+ u'before "hi@example.com" afterwards')
+ self.assertEqual(urlize('before hi@example.com" afterwards'),
+ u'before hi@example.com" afterwards')
+ self.assertEqual(urlize('before "hi@example.com afterwards'),
+ u'before "hi@example.com afterwards')
+ self.assertEqual(urlize('before \'hi@example.com\' afterwards'),
+ u'before \'hi@example.com\' afterwards')
+ self.assertEqual(urlize('before hi@example.com\' afterwards'),
+ u'before hi@example.com\' afterwards')
+ self.assertEqual(urlize('before \'hi@example.com afterwards'),
+ u'before \'hi@example.com afterwards')
+
+ # Check urlize copes with commas following URLs in quotes - see #20364
+ self.assertEqual(urlize('Email us at "hi@example.com", or phone us at +xx.yy'),
+ 'Email us at "hi@example.com", or phone us at +xx.yy')
+
def test_wordcount(self):
self.assertEqual(wordcount(''), 0)
self.assertEqual(wordcount('oneword'), 1)