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
|
// Parse Markdown links in the text
|
||||||
// credit: http://stackoverflow.com/a/9268827
|
// credit: http://stackoverflow.com/a/9268827
|
||||||
var link = d.text.match(/\[([^\]]+)\]\(([^)]+)\)/);
|
var link = null;
|
||||||
if (link)
|
while(link = d.text.match(/\[([^\]]+)\]\(([^)]+)\)/)) {
|
||||||
d.text = d.text.replace(link[0], "<a href='" + link[2] + "'>" + link[1] + "</a>");
|
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 '<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 '';
|
return '';
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user