From 3e98a54109498bc025dd38365b8cccb5856d9f53 Mon Sep 17 00:00:00 2001 From: Nuno Santos Date: Mon, 2 Dec 2013 23:53:48 +0100 Subject: [PATCH] Fixed Markdown link detection to support multiple instances. Fixes issue #5. --- index.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 9ca022c..7613823 100644 --- a/index.html +++ b/index.html @@ -233,10 +233,11 @@ h1{ // Parse Markdown links in the text // credit: http://stackoverflow.com/a/9268827 - var link = d.text.match(/\[([^\]]+)\]\(([^)]+)\)/); - if (link) + var link = null; + while(link = d.text.match(/\[([^\]]+)\]\(([^)]+)\)/)) { d.text = d.text.replace(link[0], "" + link[1] + ""); - + } + return '
' + d.time.title + ' ' + d.text + '  
'; return ''; },