From f5bced134e73cf20da42124f77ab001a38f1739b Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Thu, 9 Apr 2020 00:19:11 +0800 Subject: =?UTF-8?q?:notebook=5Fwith=5Fdecorative=5Fcover:=20Add:=20?= =?UTF-8?q?=E6=8B=93=E5=B1=95=20Markdown=20=E8=AF=AD=E6=B3=95=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20kbd=20=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/Contents.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libs/Contents.php') 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('//','',$text); } @@ -183,6 +183,14 @@ class Contents $text = preg_replace('/
/s','
',$text);
 		return $text;
 	}
+	
+	/**
+	 * 解析键盘按键
+	 */
+    static public function parseKbd($text) {
+		$text = preg_replace('/\~(.*?)\~/s','${1}',$text);
+		return $text;
+	}
 
 	/**
 	 *  解析章节链接
-- 
cgit v1.2.3