From c4017883832ee40c0045f54ed9f5a0b42450d8ac Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 4 Sep 2017 14:27:53 +0800 Subject: [PATCH] bug fixed --- public/js/libs/autolink.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/public/js/libs/autolink.js b/public/js/libs/autolink.js index 3a9c0d4bc..1fd79e89f 100644 --- a/public/js/libs/autolink.js +++ b/public/js/libs/autolink.js @@ -5,11 +5,13 @@ jQuery.fn.autolink = function() { .each(function() { $(this).each(function() { if (re.test($(this).text())) - $(this).replaceWith( - $("").html( - this.nodeValue.replace(re, "$1") - ) - ); + if($(this).parents().filter('code').length === 0) { + $(this).replaceWith( + $("").html( + this.nodeValue.replace(re, "$1") + ) + ); + }; }); }); }; \ No newline at end of file