Fixed Markdown link detection to support multiple instances.
Fixes issue #5.
This commit is contained in:
parent
c41100a58a
commit
3e98a54109
@ -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], "<a href='" + link[2] + "'>" + link[1] + "</a>");
|
||||
|
||||
}
|
||||
|
||||
return '<div class="event" style="margin-left: ' + offset.toFixed(2) + 'px"><div class="time" style="width: ' + width.toFixed(2) + 'px"></div><b>' + d.time.title + '</b> ' + d.text + ' </div>';
|
||||
return '';
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user