Index: tests/regressiontests/defaultfilters/tests.py
===================================================================
--- tests/regressiontests/defaultfilters/tests.py	(revision 7741)
+++ tests/regressiontests/defaultfilters/tests.py	(working copy)
@@ -174,10 +174,10 @@
 u'<a href="http://google.com/" rel="nofollow">http://google.com/</a>'
 
 >>> urlize('www.google.com') 
-u'<a href="http://www.google.com" rel="nofollow">http://www.google.com</a>'
+u'<a href="http://www.google.com" rel="nofollow">www.google.com</a>'
 
 >>> urlize('djangoproject.org') 
-u'<a href="http://djangoproject.org" rel="nofollow">http://djangoproject.org</a>'
+u'<a href="http://djangoproject.org" rel="nofollow">djangoproject.org</a>'
 
 >>> urlize('info@djangoproject.org') 
 u'<a href="mailto:info@djangoproject.org">info@djangoproject.org</a>'
Index: django/utils/html.py
===================================================================
--- django/utils/html.py	(revision 7741)
+++ django/utils/html.py	(working copy)
@@ -76,51 +76,50 @@
     """
     Converts any URLs in text into clickable links.
 
-    Works on http://, https://, and www. links.  Links can have trailing
-    punctuation (periods, commas, close-parens) and leading punctuation
-    (opening parens) and it'll still do the right thing.
+    Works on http://, https://, www. links and links ending in .org, .net, or .com.
+    Links can have trailing punctuation (periods, commas, close-parens) and
+    leading punctuation (opening parens) and it'll still do the right thing.
 
     If trim_url_limit is not None, the URLs in link text longer than this limit
     will truncated to trim_url_limit-3 characters and appended with an elipsis.
 
     If nofollow is True, the URLs in link text will get a rel="nofollow"
     attribute.
+    
+    If autoescape is True, the link text and URLs will get autoescaped.
     """
-    if autoescape:
-        trim_url = lambda x, limit=trim_url_limit: conditional_escape(limit is not None and (len(x) > limit and ('%s...' % x[:max(0, limit - 3)])) or x)
-    else:
-        trim_url = lambda x, limit=trim_url_limit: limit is not None and (len(x) > limit and ('%s...' % x[:max(0, limit - 3)])) or x
+    trim_url = lambda x, limit=trim_url_limit: limit is not None and (len(x) > limit and ('%s...' % x[:max(0, limit - 3)])) or x
     safe_input = isinstance(text, SafeData)
     words = word_split_re.split(force_unicode(text))
-    nofollow_attr = nofollow and ' rel="nofollow"' or ''
+    nofollow_attr = ' rel="nofollow"' if nofollow else ''
     for i, word in enumerate(words):
         match = punctuation_re.match(word)
         if match:
             lead, middle, trail = match.groups()
-            if safe_input:
-                middle = mark_safe(middle)
-            if middle.startswith('www.') or ('@' not in middle and not (middle.startswith('http://') or middle.startswith('https://')) and \
-                    len(middle) > 0 and middle[0] in string.ascii_letters + string.digits and \
-                    (middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))):
-                middle = 'http://%s' % middle
+            # Make URL we want to point to.
+            url = None
             if middle.startswith('http://') or middle.startswith('https://'):
                 url = urlquote(middle, safe='/&=:;#?+*')
+            elif middle.startswith('www.') or ('@' not in middle and \
+                    len(middle) > 0 and middle[0] in string.ascii_letters + string.digits and \
+                    (middle.endswith('.org') or middle.endswith('.net') or middle.endswith('.com'))):
+                url = urlquote('http://%s' % middle, safe='/&=:;#?+*')
+            elif '@' in middle and not ':' in middle and simple_email_re.match(middle):
+                url = 'mailto:%s' % middle
+                nofollow_attr = ''
+            # Make link.
+            if url:
+                trimmed = trim_url(middle)
                 if autoescape and not safe_input:
-                    url = escape(url)
-                trimmed_url = trim_url(middle)
-                middle = '<a href="%s"%s>%s</a>' % (url, nofollow_attr,
-                        trimmed_url)
-            elif '@' in middle and not middle.startswith('www.') and \
-                      not ':' in middle and simple_email_re.match(middle):
-                if autoescape:
-                    middle = conditional_escape(middle)
-                middle = '<a href="mailto:%s">%s</a>' % (middle, middle)
-            if lead + middle + trail != word:
-                if autoescape and not safe_input:
                     lead, trail = escape(lead), escape(trail)
+                    url, trimmed = escape(url), escape(trimmed)
+                middle = '<a href="%s"%s>%s</a>' % (url, nofollow_attr, trimmed)
                 words[i] = mark_safe('%s%s%s' % (lead, middle, trail))
-            elif autoescape and not safe_input:
-                words[i] = escape(word)
+            else:
+                if safe_input:
+                    words[i] = mark_safe(word)
+                elif autoescape:
+                    words[i] = escape(word)
         elif safe_input:
             words[i] = mark_safe(word)
         elif autoescape:
