Merge branch 'conformant_links'

This commit is contained in:
Christopher Jeffrey 2011-08-22 15:38:19 -05:00
commit 4cbc53a284

View File

@ -185,8 +185,9 @@ var inline = {
escape: /^\\([\\`*{}\[\]()#+\-.!_])/,
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
tag: /^<!--[^\0]*?-->|^<[^\n>]+>/,
link: /^!?\[([^\]]+)\]\s*\(([^\)]*)\)/,
reflink: /^!?\[([^\]]+)\]\s*\[([^\]]*)\]/,
link: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]\s*\(([^\)]*)\)/,
reflink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]\s*\[([^\]]*)\]/,
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
strong: /^__([^\0]+?)__(?!_)|^\*\*([^\0]+?)\*\*(?!\*)/,
em: /^_([^_]+)_|^\*([^*]+)\*/,
code: /^`([^`]+)`|^``([^\0]+?)``/
@ -262,7 +263,7 @@ inline.lexer = function(str) {
break;
case 'link':
case 'reflink':
if (key === 'reflink') {
if (key !== 'link') {
link = cap[2]
? links[cap[2]]
: links[cap[1]];
@ -271,7 +272,7 @@ inline.lexer = function(str) {
break;
}
} else {
text = /^\s*([^\s]*)(?:\s+"([^\n]+)")?\s*$/.exec(cap[2]);
text = /^\s*<?([^\s]*?)>?(?:\s+"([^\n]+)")?\s*$/.exec(cap[2]);
link = {
href: text[1],
title: text[2]