Skip to content

Commit c401788

Browse files
committed
bug fixed
1 parent 8335b55 commit c401788

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

public/js/libs/autolink.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ jQuery.fn.autolink = function() {
55
.each(function() {
66
$(this).each(function() {
77
if (re.test($(this).text()))
8-
$(this).replaceWith(
9-
$("<span />").html(
10-
this.nodeValue.replace(re, "<a href='$1'>$1</a>")
11-
)
12-
);
8+
if($(this).parents().filter('code').length === 0) {
9+
$(this).replaceWith(
10+
$("<span />").html(
11+
this.nodeValue.replace(re, "<a href='$1'>$1</a>")
12+
)
13+
);
14+
};
1315
});
1416
});
1517
};

0 commit comments

Comments
 (0)