allow link definitions in blockquotes too

This commit is contained in:
Federico Soave 2018-01-09 00:47:34 +01:00
parent c3e005908e
commit d7597f1732

View File

@ -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()] = {