|
@ -95,6 +95,9 @@ function links(state) { |
|
|
// Link reference
|
|
|
// Link reference
|
|
|
//
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
// do not allow nested reference links
|
|
|
|
|
|
if (state.linkLevel > 0) { return false; } |
|
|
|
|
|
|
|
|
// [foo] [bar]
|
|
|
// [foo] [bar]
|
|
|
// ^^ optional whitespace (can include newlines)
|
|
|
// ^^ optional whitespace (can include newlines)
|
|
|
for (; pos < max; pos++) { |
|
|
for (; pos < max; pos++) { |
|
@ -147,7 +150,9 @@ function links(state) { |
|
|
title: title, |
|
|
title: title, |
|
|
level: state.level++ |
|
|
level: state.level++ |
|
|
}); |
|
|
}); |
|
|
|
|
|
state.linkLevel++; |
|
|
state.parser.tokenize(state); |
|
|
state.parser.tokenize(state); |
|
|
|
|
|
state.linkLevel--; |
|
|
state.push({ type: 'link_close', level: --state.level }); |
|
|
state.push({ type: 'link_close', level: --state.level }); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|