diff --git a/lib/marked.js b/lib/marked.js index 142eccf00a..b3cc2f38cc 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -368,10 +368,17 @@ Lexer.prototype.token = function(src, top, bq) { // def if ((!bq && top) && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); - this.tokens.links[cap[1].toLowerCase()] = { + var id = cap[1].toLowerCase(); + this.tokens.links[id] = { href: cap[2], title: cap[3] }; + this.tokens.push({ + type: 'def', + id: id, + href: cap[2], + title: cap[3] + }); continue; } @@ -781,6 +788,10 @@ Renderer.prototype.blockquote = function(quote) { return '
\n' + quote + '
\n'; }; +Renderer.prototype.def = function(id, href, title) { + return ''; +}; + Renderer.prototype.html = function(html) { return html; }; @@ -966,6 +977,12 @@ Parser.prototype.tok = function() { case 'space': { return ''; } + case 'def': { + return this.renderer.def( + this.token.id, + this.token.href, + this.token.title); + } case 'hr': { return this.renderer.hr(); }