From: Chip Black Date: Mon, 10 Jan 2011 10:17:46 +0000 (-0800) Subject: Add italic/bold markdown syntax X-Git-Tag: ohfuckreddit~1 X-Git-Url: http://git.bytex64.net/?a=commitdiff_plain;h=0a73588293307fc51c995bda6f98e082a61df89c;hp=f13f6cbe98cab2e170fb714047cd794fbd39e228;p=blerg.git Add italic/bold markdown syntax --- diff --git a/www/js/blerg.js b/www/js/blerg.js index 737d84c..2ee3467 100644 --- a/www/js/blerg.js +++ b/www/js/blerg.js @@ -252,6 +252,10 @@ function mangleRecord(record, template) { // Turn markdown links into links record.data = record.data.replace(/(\s|^)\[([^\]]+)\]\((https?:\/\/[a-zA-Z0-9.-]*[a-zA-Z0-9](\/[^)]*?)?)\)/, '$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'); + // Turn refs and tags into links record.data = record.data.replace(/(\s|^)#(\w+)/g, '$1#$2'); record.data = record.data.replace(/(\s|^)@(\w+)/g, '$1@$2');