Added support for tooltips inside Markdown links.
This commit is contained in:
parent
3e98a54109
commit
66197d54ee
@ -234,8 +234,12 @@ 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 = null;
|
var link = null;
|
||||||
while(link = d.text.match(/\[([^\]]+)\]\(([^)]+)\)/)) {
|
while(link = d.text.match(/\[([^\]]+)\]\(([^)"]+)(?: \"([^\"]+)\")*\)/)) {
|
||||||
d.text = d.text.replace(link[0], "<a href='" + link[2] + "'>" + link[1] + "</a>");
|
var link_attr = "";
|
||||||
|
if (link[3] !== undefined) {
|
||||||
|
link_attr = " title='" + link[3] + "'";
|
||||||
|
}
|
||||||
|
d.text = d.text.replace(link[0], "<a href='" + link[2] + "'" + link_attr + ">" + 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>';
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
===============
|
===============
|
||||||
|
|
||||||
- 24/02/1955 Born
|
- 24/02/1955 Born
|
||||||
- ~1968 Summer [job](http://en.wikipedia.org/wiki/Beach)!
|
- ~1968 Summer [job](http://en.wikipedia.org/wiki/Beach "Job...")!
|
||||||
- 03/1976 Built a computer
|
- 03/1976 Built a computer
|
||||||
- 01/04/1976 Started a company
|
- 01/04/1976 Started a company
|
||||||
- 04/1976-2011 Whole bunch of interesting events
|
- 04/1976-2011 Whole bunch of interesting events
|
Loading…
Reference in New Issue
Block a user