link ref bug
This commit is contained in:
parent
dbb20c0e40
commit
d8ff5178c6
@ -229,7 +229,7 @@ inline.text = (function(rules) {
|
||||
inline.lexer = function(str) {
|
||||
var out = ''
|
||||
, links = tokens.links
|
||||
, link = {}
|
||||
, link
|
||||
, text
|
||||
, href;
|
||||
|
||||
@ -264,8 +264,10 @@ inline.lexer = function(str) {
|
||||
if (key === 'reflink') {
|
||||
link = links[cap[2]];
|
||||
} else {
|
||||
link.href = cap[2];
|
||||
link.title = cap[3];
|
||||
link = {
|
||||
href: cap[2],
|
||||
title: cap[3]
|
||||
};
|
||||
}
|
||||
out += '<a href="'
|
||||
+ escape(link.href)
|
||||
@ -283,8 +285,10 @@ inline.lexer = function(str) {
|
||||
link = links[cap[2]];
|
||||
} else {
|
||||
text = /^([^\s]+)\s*(.+)?$/.exec(cap[2]);
|
||||
link.href = text[1];
|
||||
link.title = text[2];
|
||||
link = {
|
||||
href: text[1],
|
||||
title: text[2]
|
||||
};
|
||||
}
|
||||
out += '<img src="'
|
||||
+ escape(link.href)
|
||||
|
Loading…
x
Reference in New Issue
Block a user