summaryrefslogtreecommitdiff
path: root/includes/post-content.php
diff options
context:
space:
mode:
author阔落 <45323514+BigCoke233@users.noreply.github.com>2019-03-30 16:17:46 +0800
committerGitHub <noreply@github.com>2019-03-30 16:17:46 +0800
commitfa517835b688184455c6942ecac466b8e17f9ad7 (patch)
tree7f13f50ab025db074f1a76e21541ec0e8ad1e81b /includes/post-content.php
parent24ef0d2a0c9483879c195a76e77a477db3f6ca72 (diff)
Add files via upload
Diffstat (limited to 'includes/post-content.php')
-rw-r--r--includes/post-content.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/post-content.php b/includes/post-content.php
index c2f1a12..b60b52e 100644
--- a/includes/post-content.php
+++ b/includes/post-content.php
@@ -1,6 +1,8 @@
<?php
- //解析灯箱及图片描述
+ //解析灯箱、图片描述、表格、代码框
$content = preg_replace('/<img(.*?)src="(.*?)" alt="(.*?)" title="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}"><img${1}src="${2}"${5}></a><span class="post-img-alt">${4}</span>',$this->content);
+ $content = preg_replace('/<table(.*?)>/s','<table class="table table-striped table-hover">',$this->content);
+ $content = preg_replace('/<pre><code>/s','<pre><code class="language-html">',$this->content);
//短代码(无参数)
$reg = '/\[scode\](.*?)\[\/scode\]/s';