X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjs%2Fblerg.js;h=4d56790802125a42c504febc1b2c7f01246c09f0;hb=02b61f4e1986828cd7b86d2bc448ca9534e5d19f;hp=dcb56790742476335121b8810d7f304d07d3bce0;hpb=93ac2090dfae4917cfdd3324d35b60756f5dd8b3;p=blerg.git diff --git a/www/js/blerg.js b/www/js/blerg.js index dcb5679..4d56790 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -244,17 +244,17 @@ function mangleRecord(record, template) { record.recInt = parseInt(record.record); // Sanitize HTML input - record.data = record.data.replace('&', '&').replace('<', '<').replace('>', '>'); + record.data = record.data.replace(/&/g, '&').replace(//g, '>'); // Turn HTTP URLs into links record.data = record.data.replace(/(\s|^)(https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/([^\s"]*[^.!,;?()\s])?)?)/g, '$1$2'); // Turn markdown links into links - record.data = record.data.replace(/(\s|^)\[([^\]]+)\]\((https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/[^)"]*?)?)\)/, '$1$2'); + record.data = record.data.replace(/(\s|^)\[([^\]]+)\]\((https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/[^)"]*?)?)\)/g, '$1$2'); // Turn *foo* into italics and **foo** into bold - record.data = record.data.replace(/(\s)\*\*([^*]+)\*\*(\s)/, '$1$2$3'); - record.data = record.data.replace(/(\s)\*([^*]+)\*(\s)/, '$1$2$3'); + record.data = record.data.replace(/(\s)\*\*([^*]+)\*\*(\s)/g, '$1$2$3'); + record.data = record.data.replace(/(\s)\*([^*]+)\*(\s)/g, '$1$2$3'); // Turn refs and tags into links record.data = record.data.replace(/(\s|^)#(\w+)/g, '$1#$2');