summaryrefslogtreecommitdiff
path: root/includes/post-content.php
diff options
context:
space:
mode:
author阔落 <45323514+BigCoke233@users.noreply.github.com>2019-03-31 13:47:33 +0800
committerGitHub <noreply@github.com>2019-03-31 13:47:33 +0800
commit0b71b73f502022b6be3c7cf0116c5827dec85da9 (patch)
tree90e354c55c3959339af8c9afae1d31e4e8524afc /includes/post-content.php
parent855c860ad57cd7f05749af4a7d32e16969a2a87e (diff)
Bug fix
Diffstat (limited to 'includes/post-content.php')
-rw-r--r--includes/post-content.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/includes/post-content.php b/includes/post-content.php
index 5aa7653..21a45ce 100644
--- a/includes/post-content.php
+++ b/includes/post-content.php
@@ -1,8 +1,11 @@
<?php
- $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);
- $content = preg_replace('/<img(.*?)src="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}"><img${1}src="${2}"${3}></a>',$this->content);
+ $content = $this->content;
+
+ $content = preg_replace('/<table(.*?)>/s','<table class="table table-striped table-hover">',$content);
+ $content = preg_replace('/<pre><code>/s','<pre><code class="language-html">',$content);
+ $content = preg_replace('/<img(.*?)src="(.*?)"(.*?)>/s','<a data-fancybox="gallery" href="${2}"><img${1}src="${2}"${3}></a>',$content);
+
//短代码(无参数)
$reg = '/\[scode\](.*?)\[\/scode\]/s';
$rp = '<div class="tip">${1}</div>';
@@ -43,7 +46,6 @@
$reg = '/\[stext\](.*?)\[\/stext\]/s';
$rp = '<div class="post-stext">${1}</div>';
$content = preg_replace($reg,$rp,$content);
-
-
- echo $content
+
+ echo $content;
?> \ No newline at end of file