From 236d263a26d52048f1c7073ad86297c6372e524c Mon Sep 17 00:00:00 2001 From: spirit Date: Wed, 27 Nov 2019 08:31:36 +0800 Subject: [PATCH] close #143 --- functions.php | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/functions.php b/functions.php index e058a1b..84c5e3b 100644 --- a/functions.php +++ b/functions.php @@ -1557,6 +1557,44 @@ function html_tag_parser($content) { ', $content ); + } + //html tag parser for rss + if(is_feed()) { + //Fancybox + $url_regex ='((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))'; + if (preg_match_all('/\!\{.*?\)\[.*?\]/i', $content,$matches)){ + $i=0; + if ($i', + $matches[$i]), + $content); + $i++; + } + } + $content=preg_replace( + '/!\{([^\{\}]+)*\}\('.$url_regex.'\)/i', + '', + $content + ); + + //Github cards + $content=preg_replace( + '/\[github repo=[\'"]([^\'"]+)[\'"]\]/i', + '