Clarify privacy/data policies
[blerg.git] / www / jssrc / blerg / Util.js
index 78081ed..2734b36 100644 (file)
@@ -16,7 +16,7 @@ blerg.Util.formatLinkHooks = [
 ];
 
 blerg.Util.formatMarkdownLinks = function(l) {
-        m = l.match(/(\s|^)\[([^\]]+)\]\((https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/[^)"]*?)?)(\s([^)]*))?\)/);
+        m = l.match(/(\s[()\[\]{}]?|^)\[([^\]]+)\]\((https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/[^)"]*?)?|mailto:[^)"]*?)(\s([^)]*))?\)/);
         if (!m)
             return l;
         var whitespace = m[1];
@@ -72,7 +72,7 @@ blerg.Util.blergFormat = function(text) {
         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
         l = blerg.Util.formatMarkdownLinks(l);