Recognize links inside parentheses/brackets
authorChip Black <bytex64@bytex64.net>
Thu, 13 Sep 2012 06:01:12 +0000 (23:01 -0700)
committerChip Black <bytex64@bytex64.net>
Thu, 13 Sep 2012 06:01:12 +0000 (23:01 -0700)
www/js/blerg.js

index 2ef48d9..8cb5bab 100644 (file)
@@ -401,7 +401,7 @@ function mangleRecord(record, template) {
         l = l.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
 
         // Turn HTTP URLs into links
-        l = l.replace(/(\s|^)(https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/([^\s"]*[^.!,;?()\s])?)?)/g, '$1<a href="$2">$2</a>');
+        l = l.replace(/(\s[()\[\]{}]?|^)(https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/([^\s"]*[^.!,;?()\s])?)?)/g, '$1<a href="$2">$2</a>');
 
         // Turn markdown links into links
         var re;