forked from mirror/MrDoc
修复@符号导致的Markdown链接解析异常
This commit is contained in:
parent
506ec6eb1b
commit
d732871739
@ -3758,28 +3758,28 @@
|
||||
// marked @ 解析
|
||||
markedRenderer.atLink = function(text) {
|
||||
|
||||
if (atLinkReg.test(text))
|
||||
{
|
||||
if (settings.atLink)
|
||||
{
|
||||
text = text.replace(emailReg, function($1, $2, $3, $4) {
|
||||
return $1.replace(/@/g, "_#_@_#_");
|
||||
});
|
||||
// if (atLinkReg.test(text))
|
||||
// {
|
||||
// if (settings.atLink)
|
||||
// {
|
||||
// text = text.replace(emailReg, function($1, $2, $3, $4) {
|
||||
// return $1.replace(/@/g, "_#_@_#_");
|
||||
// });
|
||||
|
||||
text = text.replace(atLinkReg, function($1, $2) {
|
||||
return "<a href=\"" + editormd.urls.atLinkBase + "" + $2 + "\" title=\"@" + $2 + "\" class=\"at-link\">" + $1 + "</a>";
|
||||
}).replace(/_#_@_#_/g, "@");
|
||||
}
|
||||
|
||||
if (settings.emailLink)
|
||||
{
|
||||
text = text.replace(emailLinkReg, function($1, $2, $3, $4, $5) {
|
||||
return (!$2 && $.inArray($5, "jpg|jpeg|png|gif|webp|ico|icon|pdf".split("|")) < 0) ? "<a href=\"mailto:" + $1 + "\">"+$1+"</a>" : $1;
|
||||
});
|
||||
}
|
||||
// text = text.replace(atLinkReg, function($1, $2) {
|
||||
// return "<a href=\"" + editormd.urls.atLinkBase + "" + $2 + "\" title=\"@" + $2 + "\" class=\"at-link\">" + $1 + "</a>";
|
||||
// }).replace(/_#_@_#_/g, "@");
|
||||
// }
|
||||
|
||||
return text;
|
||||
}
|
||||
// if (settings.emailLink)
|
||||
// {
|
||||
// text = text.replace(emailLinkReg, function($1, $2, $3, $4, $5) {
|
||||
// return (!$2 && $.inArray($5, "jpg|jpeg|png|gif|webp|ico|icon|pdf".split("|")) < 0) ? "<a href=\"mailto:" + $1 + "\">"+$1+"</a>" : $1;
|
||||
// });
|
||||
// }
|
||||
|
||||
// return text;
|
||||
// }
|
||||
|
||||
return text;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user