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
|
* Lexing
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Lexer.prototype.token = function(src, top, bq) {
|
Lexer.prototype.token = function(src, top) {
|
||||||
var src = src.replace(/^ +$/gm, '')
|
var src = src.replace(/^ +$/gm, '')
|
||||||
, next
|
, next
|
||||||
, loose
|
, loose
|
||||||
@ -278,7 +278,7 @@ Lexer.prototype.token = function(src, top, bq) {
|
|||||||
// Pass `top` to keep the current
|
// Pass `top` to keep the current
|
||||||
// "toplevel" state. This is exactly
|
// "toplevel" state. This is exactly
|
||||||
// how markdown.pl works.
|
// how markdown.pl works.
|
||||||
this.token(cap, top, true);
|
this.token(cap, top);
|
||||||
|
|
||||||
this.tokens.push({
|
this.tokens.push({
|
||||||
type: 'blockquote_end'
|
type: 'blockquote_end'
|
||||||
@ -347,7 +347,7 @@ Lexer.prototype.token = function(src, top, bq) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Recurse.
|
// Recurse.
|
||||||
this.token(item, false, bq);
|
this.token(item, false);
|
||||||
|
|
||||||
this.tokens.push({
|
this.tokens.push({
|
||||||
type: 'list_item_end'
|
type: 'list_item_end'
|
||||||
@ -376,7 +376,7 @@ Lexer.prototype.token = function(src, top, bq) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// def
|
// def
|
||||||
if ((!bq && top) && (cap = this.rules.def.exec(src))) {
|
if (top && (cap = this.rules.def.exec(src))) {
|
||||||
src = src.substring(cap[0].length);
|
src = src.substring(cap[0].length);
|
||||||
if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1);
|
if (cap[3]) cap[3] = cap[3].substring(1,cap[3].length-1);
|
||||||
this.tokens.links[cap[1].toLowerCase()] = {
|
this.tokens.links[cap[1].toLowerCase()] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user