diff options
| author | BigCoke233 <hi@guhub.cn> | 2020-04-15 12:15:18 +0800 |
|---|---|---|
| committer | BigCoke233 <hi@guhub.cn> | 2020-04-15 12:15:18 +0800 |
| commit | 7866c9f6a2353fd93a279b5a22872c52bb81b08b (patch) | |
| tree | 8ebfac54ff49ab61ec79f3ea551ef457f1bc21d6 | |
| parent | ae0351105cebf8a3787d8ebb454a25f80dbe0e6d (diff) | |
:dizzy: Add: 支持解析图题
| -rw-r--r-- | assets/css/main/post.css | 4 | ||||
| -rw-r--r-- | libs/Contents.php | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/assets/css/main/post.css b/assets/css/main/post.css index 9e5c2fe..6aaeff2 100644 --- a/assets/css/main/post.css +++ b/assets/css/main/post.css @@ -388,6 +388,10 @@ .post-img-shadow img {
box-shadow: 0 8px 15px rgba(0,0,0,0.45);
}
+.post-img-alt {
+ font-size: 0.9em;
+ color: gray
+}
/* >文章分页 */
.post-pagenav,
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; } |
