This commit is contained in:
Christopher Jeffrey 2011-08-13 21:21:26 -05:00
parent 0b200e4ab3
commit 03cc80ad81

View File

@ -178,11 +178,11 @@ lex.token = function lex(str, tokens, line) {
var inline = (function() { var inline = (function() {
var inline = { var inline = {
tag: /^<[^\n>]+>/, tag: /^<[^\n:>]+>/,
img: /^!\[([^\]]+)\]\(([^\s\)]+)\s*([^\)]*)\)/, img: /^!\[([^\]]+)\]\(([^\s\)]+)\s*([^\)]*)\)/,
link: /^\[([^\]]+)\]\(([^\)]+)\)/, link: /^\[([^\]]+)\]\(([^\)]+)\)/,
reflink: /^\[([^\]]+)\]\[([^\]]+)\]/, reflink: /^\[([^\]]+)\]\[([^\]]+)\]/,
autolink: /^<([^<>:\/ ]+:(?:\/\/)?[^>\n]+?)|([^<>\n]+?@[^<>\n]+?)>/, autolink: /^<([^\n>]+)>/,
strong: /^__([\s\S]+?)__|^\*\*([\s\S]+?)\*\*/, strong: /^__([\s\S]+?)__|^\*\*([\s\S]+?)\*\*/,
em: /^_([^_]+)_|^\*([^*]+)\*/, em: /^_([^_]+)_|^\*([^*]+)\*/,
escape: /^`([^`]+)`|^``([\s\S]+?)``/ escape: /^`([^`]+)`|^``([\s\S]+?)``/
@ -191,7 +191,7 @@ var inline = (function() {
inline.text = new RegExp( inline.text = new RegExp(
'^([\\s\\S]+?)(?=' '^([\\s\\S]+?)(?='
+ Object.keys(inline).map(function(key) { + Object.keys(inline).map(function(key) {
return inline[key].source.replace(/(^|\|)\^/g, '$1'); return inline[key].source.replace(/(^|[^\[])\^/g, '$1');
}).join('|') }).join('|')
+ '|$)' + '|$)'
); );