summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/Contents.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/Contents.php b/libs/Contents.php
index 06e7246..da552a5 100644
--- a/libs/Contents.php
+++ b/libs/Contents.php
@@ -14,7 +14,7 @@ class Contents
$text = empty($last) ? $data : $last;
if ($widget instanceof Widget_Archive) {
//ParseOther
- $text = Contents::parseEmo(Contents::parseCode(Contents::parseImages(Contents::parseHeadings(Contents::parseTextColor(Contents::parseRuby(Contents::parseTip(Contents::parseLink($text))))))));
+ $text = Contents::parseEmo(Contents::parseKbd(Contents::parseCode(Contents::parseImages(Contents::parseHeadings(Contents::parseTextColor(Contents::parseRuby(Contents::parseTip(Contents::parseLink($text)))))))));
//LazyLoad
$text = preg_replace('/<img (.*?)src(.*?)(\/)?>/','<img $1src="/usr/themes/Miracles/images/loading/'.$load_image.'.gif" data-original$2 />',$text);
}
@@ -183,6 +183,14 @@ class Contents
$text = preg_replace('/<pre><code>/s','<pre><code class="language-html">',$text);
return $text;
}
+
+ /**
+ * 解析键盘按键
+ */
+ static public function parseKbd($text) {
+ $text = preg_replace('/\~(.*?)\~/s','<kbd>${1}</kbd>',$text);
+ return $text;
+ }
/**
* 解析章节链接