]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix docstring formatting
authorBen Darnell <ben@bendarnell.com>
Sun, 20 May 2012 23:57:36 +0000 (16:57 -0700)
committerBen Darnell <ben@bendarnell.com>
Sun, 20 May 2012 23:57:36 +0000 (16:57 -0700)
tornado/escape.py

index 71083e7755a2c7301f40c11f9c52b6557e8a8113..ed07c53d186c715c257559b35a7e01b22f1f3742 100644 (file)
@@ -248,13 +248,15 @@ def linkify(text, shorten=False, extra_params="",
 
     extra_params: Extra text to include in the link tag, or a callable
         taking the link as an argument and returning the extra text
-        e.g. linkify(text, extra_params='rel="nofollow" class="external"')
-          or def extra_params_cb(url):
-                 if url.startswith("http://example.com"):
-                     return 'class="internal"'
-                 else:
-                     return 'class="external" rel="nofollow"'
-             linkify(text, extra_params=extra_params_cb)
+        e.g. ``linkify(text, extra_params='rel="nofollow" class="external"')``,
+        or::
+
+            def extra_params_cb(url):
+                if url.startswith("http://example.com"):
+                    return 'class="internal"'
+                else:
+                    return 'class="external" rel="nofollow"'
+            linkify(text, extra_params=extra_params_cb)
 
     require_protocol: Only linkify urls which include a protocol. If this is
         False, urls such as www.facebook.com will also be linkified.