summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEltrac <45323514+BigCoke233@users.noreply.github.com>2020-01-22 19:15:33 +0800
committerGitHub <noreply@github.com>2020-01-22 19:15:33 +0800
commitf520d0d448d82dd65a56c0bd0a8423a3a3b8a9f5 (patch)
tree9f9a81613fb3081006c499df2ccba16daf9446d2
parentdbc15b93601157561c9ee688d3888db9159b937b (diff)
😣 Add: 新的短代码——自定义字体颜色和 ruby
-rw-r--r--libs/Contents.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/Contents.php b/libs/Contents.php
index 64186fa..4a5cb3c 100644
--- a/libs/Contents.php
+++ b/libs/Contents.php
@@ -29,6 +29,14 @@ class Contents
//气泡
$text = preg_replace('/\[bubble\](.*?)\[\/bubble\]/s','<div class="bubble post-bubble"><div class="saying-content"><p>${1}</p></div></div>',$text);
+ //阴影
+ $text = preg_replace('/\&\{\"(.*?)\"\|(.*?)\|(.*?)\}/s','<span style="color:${2};background:${3}">${1}</span>',$text);
+
+ //ruby
+ $reg = '/\{\{(.*?):(.*?)\}\}/s';
+ $rp = '<ruby>${1}<rp>(</rp><rt>${2}</rt><rp>)</rp></ruby>';
+ $text = preg_replace($reg,$rp,$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