Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Commit

Permalink
Added todo for linking to headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
octalmage committed Sep 21, 2014
1 parent 6fa38df commit 273fd4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ var validImageExtensions = new Array("png", "gif", "bmp", "jpeg", "jpg");

//Custom Renderer
var renderer = new marked.Renderer();

//[todo] - Add better support for linking to headers.
renderer.link = function(href, title, text)
{
var output;
if (href.indexOf("://") !== -1)
{
output = "<a target=\"_blank\" href=\"" + href + "\">" + text + "</a>";
}
else if (href.indexOf("#") !== -1)
else if (href.indexOf("#") !== -1) //Allow linking to a header using #.
{
output = "<a href=\"" + href + "\">" + text + "</a>";
}
Expand Down

0 comments on commit 273fd4e

Please sign in to comment.