mirror of
https://github.com/markedjs/marked
synced 2024-11-23 18:02:12 +00:00
allow link definitions in blockquotes too
This commit is contained in:
parent
c3e005908e
commit
d7597f1732
@ -155,7 +155,7 @@ Lexer.prototype.lex = function(src) {
|
||||
* Lexing
|
||||
*/
|
||||
|
||||
Lexer.prototype.token = function(src, top, bq) {
|
||||
Lexer.prototype.token = function(src, top) {
|
||||
var src = src.replace(/^ +$/gm, '')
|
||||
, next
|
||||
, loose
|
||||
@ -278,7 +278,7 @@ Lexer.prototype.token = function(src, top, bq) {
|
||||
// Pass `top` to keep the current
|
||||
// "toplevel" state. This is exactly
|
||||
// how markdown.pl works.
|
||||
this.token(cap, top, true);
|
||||
this.token(cap, top);
|
||||
|
||||
this.tokens.push({
|
||||
type: 'blockquote_end'
|
||||
@ -347,7 +347,7 @@ Lexer.prototype.token = function(src, top, bq) {
|
||||
});
|
||||
|
||||
// Recurse.
|
||||
this.token(item, false, bq);
|
||||
this.token(item, false);
|
||||
|
||||
this.tokens.push({
|
||||
type: 'list_item_end'
|
||||
@ -376,7 +376,7 @@ Lexer.prototype.token = function(src, top, bq) {
|
||||
}
|
||||
|
||||
// def
|
||||
if ((!bq && top) && (cap = this.rules.def.exec(src))) {
|
||||
if (top && (cap = this.rules.def.exec(src))) {
|
||||
src = src.substring(cap[0].length);
|
||||
if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1);
|
||||
this.tokens.links[cap[1].toLowerCase()] = {
|
||||
|
Loading…
Reference in New Issue
Block a user