From 75d54646e8574c9afabae7b56088a5afad76d94a Mon Sep 17 00:00:00 2001 From: spirit Date: Thu, 18 Jul 2019 15:27:48 +0800 Subject: [PATCH] bug fix --- functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions.php b/functions.php index c7dab6b..a16b3dd 100644 --- a/functions.php +++ b/functions.php @@ -952,6 +952,8 @@ function rt_add_link_target( $content ){ foreach( $bits as $key=>$bit ){ // fix the target="_blank" bug after the link if ( strpos( $bit, 'href' ) === false ) continue; + // fix the target="_blank" bug in the codeblock + if ( strpos( preg_replace('/code([\s\S]*?)\/code[\s]*/m','temp',$content), $bit ) === false ) continue; // find the end of each link $pos = strpos( $bit, '>' ); // check if there is an end (only fails with malformed markup)