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