summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2020-04-15 12:15:18 +0800
committerBigCoke233 <hi@guhub.cn>2020-04-15 12:15:18 +0800
commit7866c9f6a2353fd93a279b5a22872c52bb81b08b (patch)
tree8ebfac54ff49ab61ec79f3ea551ef457f1bc21d6 /libs
parentae0351105cebf8a3787d8ebb454a25f80dbe0e6d (diff)
:dizzy: Add: 支持解析图题
Diffstat (limited to 'libs')
-rw-r--r--libs/Contents.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/Contents.php b/libs/Contents.php
index e65d81b..75aa833 100644
--- a/libs/Contents.php
+++ b/libs/Contents.php
@@ -29,8 +29,8 @@ class Contents
* 解析图片
*/
static public function parseImages($text){
- //FancyBox
- $text = preg_replace('/<img(.*?)src="(.*?)"(.*?)alt="(.*?)"(.*?)>/s','<center><a data-fancybox="gallery" href="${2}" class="gallery-link"><img${1}src="${2}"${3}></a></center>',$text);
+ //FancyBox & 图题
+ $text = preg_replace('/<img(.*?)src="(.*?)"(.*?)alt="(.*?)"(.*?)>/s','<center><a data-fancybox="gallery" href="${2}" class="gallery-link"><img${1}src="${2}"${3}></a><span class="post-img-alt">${4}</span></center>',$text);
return $text;
}