reflinks
This commit is contained in:
parent
4719f5eb87
commit
8d85d8352f
@ -247,7 +247,7 @@ var inline = {
|
||||
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
|
||||
tag: /^<[^\n>]+>/,
|
||||
link: /^!?\[([^\]]+)\] *\(([^\)]*)\)/,
|
||||
reflink: /^!?\[([^\]]+)\] *\[([^\]]+)\]/,
|
||||
reflink: /^!?\[([^\]]+)\] *\[([^\]]*)\]/,
|
||||
strong: /^__([\s\S]+?)__|^\*\*([\s\S]+?)\*\*/,
|
||||
em: /^_([^_]+)_|^\*([^*]+)\*/,
|
||||
code: /^`([^`]+)`|^``([\s\S]+?)``/
|
||||
@ -325,9 +325,13 @@ inline.lexer = function(str) {
|
||||
case 'reflink':
|
||||
if (cap[0][0] !== '!') {
|
||||
if (key === 'reflink') {
|
||||
link = links[cap[2]];
|
||||
if (!link) throw new
|
||||
Error('Undefined Reference: ' + cap[2]);
|
||||
link = links[cap[2]] || links[cap[1]];
|
||||
if (!link) {
|
||||
out += cap[0];
|
||||
break;
|
||||
}
|
||||
//if (!link) throw new
|
||||
// Error('Undefined Reference: ' + cap[2]);
|
||||
} else {
|
||||
text = /^\s*([^\s]*)(?:\s+"([^"]+)")?\s*$/.exec(cap[2]);
|
||||
link = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user