From 7f7b24d28fe2b703fbdb6162c7161aad454d3a7e Mon Sep 17 00:00:00 2001 From: Kane Date: Tue, 7 Jun 2022 18:08:24 +0800 Subject: [PATCH] Minor update (#1451) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update - 更新 Windows 和 Linux 系统中文本编辑器样式问题(为代码块中添加中文后备字体修正样式) * Update - 缩略图支持识别 avif 图片(具体可参考https://en.wikipedia.org/wiki/AVIF ) --- admin/css/style.css | 4 ++-- var/Widget/Base/Contents.php | 2 +- var/Widget/Themes/Rows.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/css/style.css b/admin/css/style.css index 3ac26345..0db7d36b 100644 --- a/admin/css/style.css +++ b/admin/css/style.css @@ -4,13 +4,13 @@ /** Typecho 全局样式 */ html { height: 100%; } -body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; background: #F6F6F3; color: #444; font-size: 87.5%; line-height: 1.5; } +body { font-family: 'Helvetica Neue', Helvetica, Arial, -apple-system, system-ui, sans-serif; background: #F6F6F3; color: #444; font-size: 87.5%; line-height: 1.5; } a { color: #467B96; text-decoration: none; } a:hover { color: #499BC3; text-decoration: underline; } -code, pre, .mono { font-family: Menlo, Monaco, Consolas, "Courier New", monospace; } +code, pre, .mono { font-family: 'SF Mono', Menlo, Monaco, Consolas, 'Courier New', -apple-system, system-ui, monospace; } .p { margin: 1em 0; } diff --git a/var/Widget/Base/Contents.php b/var/Widget/Base/Contents.php index 184827aa..8a7aba6e 100644 --- a/var/Widget/Base/Contents.php +++ b/var/Widget/Base/Contents.php @@ -554,7 +554,7 @@ class Contents extends Base implements QueryInterface //增加数据信息 $value['attachment'] = new Config($content); - $value['attachment']->isImage = in_array($content['type'], ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'bmp', 'webp']); + $value['attachment']->isImage = in_array($content['type'], ['jpg', 'jpeg', 'gif', 'png', 'tiff', 'bmp', 'webp', 'avif']); $value['attachment']->url = Upload::attachmentHandle($value); if ($value['attachment']->isImage) { diff --git a/var/Widget/Themes/Rows.php b/var/Widget/Themes/Rows.php index 5fdbdf82..8662422f 100644 --- a/var/Widget/Themes/Rows.php +++ b/var/Widget/Themes/Rows.php @@ -45,7 +45,7 @@ class Rows extends Widget } $screen = array_filter(glob($theme . '/*'), function ($path) { - return preg_match("/screenshot\.(jpg|png|gif|bmp|jpeg|webp)$/i", $path); + return preg_match("/screenshot\.(jpg|png|gif|bmp|jpeg|webp|avif)$/i", $path); }); if ($screen) {