Merge branch 'conformant_links'
This commit is contained in:
commit
4cbc53a284
@ -185,8 +185,9 @@ var inline = {
|
|||||||
escape: /^\\([\\`*{}\[\]()#+\-.!_])/,
|
escape: /^\\([\\`*{}\[\]()#+\-.!_])/,
|
||||||
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
|
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
|
||||||
tag: /^<!--[^\0]*?-->|^<[^\n>]+>/,
|
tag: /^<!--[^\0]*?-->|^<[^\n>]+>/,
|
||||||
link: /^!?\[([^\]]+)\]\s*\(([^\)]*)\)/,
|
link: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]\s*\(([^\)]*)\)/,
|
||||||
reflink: /^!?\[([^\]]+)\]\s*\[([^\]]*)\]/,
|
reflink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]\s*\[([^\]]*)\]/,
|
||||||
|
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
|
||||||
strong: /^__([^\0]+?)__(?!_)|^\*\*([^\0]+?)\*\*(?!\*)/,
|
strong: /^__([^\0]+?)__(?!_)|^\*\*([^\0]+?)\*\*(?!\*)/,
|
||||||
em: /^_([^_]+)_|^\*([^*]+)\*/,
|
em: /^_([^_]+)_|^\*([^*]+)\*/,
|
||||||
code: /^`([^`]+)`|^``([^\0]+?)``/
|
code: /^`([^`]+)`|^``([^\0]+?)``/
|
||||||
@ -262,7 +263,7 @@ inline.lexer = function(str) {
|
|||||||
break;
|
break;
|
||||||
case 'link':
|
case 'link':
|
||||||
case 'reflink':
|
case 'reflink':
|
||||||
if (key === 'reflink') {
|
if (key !== 'link') {
|
||||||
link = cap[2]
|
link = cap[2]
|
||||||
? links[cap[2]]
|
? links[cap[2]]
|
||||||
: links[cap[1]];
|
: links[cap[1]];
|
||||||
@ -271,7 +272,7 @@ inline.lexer = function(str) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
text = /^\s*([^\s]*)(?:\s+"([^\n]+)")?\s*$/.exec(cap[2]);
|
text = /^\s*<?([^\s]*?)>?(?:\s+"([^\n]+)")?\s*$/.exec(cap[2]);
|
||||||
link = {
|
link = {
|
||||||
href: text[1],
|
href: text[1],
|
||||||
title: text[2]
|
title: text[2]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user