[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#610220: Show URLs in TODO/NOTE as hyperlinks in the web view



Hi,

attached is a patch to lib/python/web_support.py which turns the notes (used 
in CVEs) into hyperlinks - if they start with http(s)://

Please tell me whether it's ok to commit this.


cheers,
	Holger
Index: lib/python/web_support.py
===================================================================
--- lib/python/web_support.py	(Revision 28738)
+++ lib/python/web_support.py	(Arbeitskopie)
@@ -453,12 +453,16 @@
 
 def make_pre(lines):
     """Creates a pre-formatted text area."""
-    r = []
-    append = r.append
+    pre = []
+    append = pre.append
     for l in lines:
-        append(l)
-        append('\n')
-    return tag('pre', ''.join(r))
+        # please tell me once gopher:// is back
+        if l.startswith('http://') or l.startswith('https://'):
+            append(A(l))
+        else:
+            append(l)
+        append(BR())
+    return tag('pre', pre)
 
 def make_menu(convert, *entries):
     """Creates an unnumbered list of hyperlinks.

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: