From 0a73588293307fc51c995bda6f98e082a61df89c Mon Sep 17 00:00:00 2001 From: Chip Black Date: Mon, 10 Jan 2011 02:17:46 -0800 Subject: [PATCH] Add italic/bold markdown syntax --- www/js/blerg.js | 4 ++++ 1 file changed, 4 insertions(+) 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'); -- 2.25.1