This commit is contained in:
Christopher Jeffrey 2011-08-21 08:33:56 -05:00
parent 8ff9c48d26
commit a722edbf32

View File

@ -95,7 +95,7 @@ block.lexer = function(str) {
function(_, id, href, title) {
links[id] = {
href: href,
title: title
title: unquote(title)
};
return '';
}
@ -326,7 +326,7 @@ inline.lexer = function(str) {
} else {
link = {
href: cap[2],
title: cap[3]
title: unquote(cap[3])
};
}
out += '<a href="'
@ -349,7 +349,7 @@ inline.lexer = function(str) {
text = /^([^\s]+)\s*(.+)?$/.exec(cap[2]);
link = {
href: text[1],
title: text[2]
title: unquote(text[2])
};
}
out += '<img src="'
@ -527,6 +527,13 @@ var each = function(obj, func) {
for (; i < l; i++) func(obj[i]);
};
var unquote = function(str) {
if (!str) return str;
var ch = str[0];
return (ch === '"' || ch === '\'')
? str.slice(1, -1) : str;
};
/**
* Expose
*/