diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/Contents.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/Contents.php b/libs/Contents.php index fd2c8f1..d441577 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -8,16 +8,25 @@ class Contents */ static public function parseContent($text) { + //Prism 高亮 $text = preg_replace('/<pre><code>/s','<pre><code class="language-html">',$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); //LazyLoad $text = preg_replace('/<img (.*?)src(.*?)(\/)?>/','<img $1src="/usr/themes/Miracles/images/loading.gif"'.$style.' data-original$2 />',$text); + //气泡 + $text = preg_replace('/\[bubble\](.*?)\[\/bubble\]/s','<div class="bubble post-bubble"><div class="saying-content"><p>${1}</p></div></div>',$text); + + //Tip without var + $text = preg_replace('/\[tip\](.*?)\[\/tip\]/s','<div class="tip"><div class="container-fluid"><div class="row"><div class="col-1 tip-icon"><i class="iconfont icon-info"></i></div><div class="col-11 tip-content">${1}</div></div></div></div>',$text); + //Tip + $text = preg_replace('/\[tip type="(.*?)"\](.*?)\[\/tip\]/s','<div class="tip ${1}"><div class="container-fluid"><div class="row"><div class="col-1 tip-icon"><i class="iconfont icon-info"></i></div><div class="col-11 tip-content">${2}</div></div></div></div>',$text); + //解析友链盒子 $reg = '/\[links\](.*?)\[\/links\]/s'; $rp = '<div class="links-box container-fluid"><div class="row">${1}</div></div>'; $text = preg_replace($reg,$rp,$text); - //解析友链项目 $reg = '/\[(.*?)\]\{(.*?)\}\((.*?)\)/s'; $rp = '<div class="col-lg-2 col-4 col-md-3 links-container"> |
