Skip to content

header 中的 code 元素顯示異常 #388

@chuan13

Description

@chuan13

Issue Checklist | Issue 检查清单

Expected behavior | 预期行为

預期顯示類似 Landscape 主題,code 元素部分字體不同、背景色不同,但字體大小和所在的 header 元素相近,如下圖:
keep-theme-code-in-header-bug-landscape

Actual behavior | 实际行为

實際使用 Keep 主題的顯示結果,如下圖:
keep-theme-code-in-header-bug-keep

Steps to reproduce the behavior | 重现步骤

  1. 建立一個 post,並加入以下內容:
## this is a `code` in h2
  1. hexo clean && hexo g && hexo s --open
  2. 找到該篇文章查看顯示結果

Node.js and NPM Information | Node.js 和 NPM 信息

$ node -v && npm -v
v22.11.0
10.9.0

Hexo Configuration | Hexo 配置

theme: keep

以上內容之外,未改動預設內容。

Keep Configuration | Keep 配置

未改動預設內容。

Other Information | 其它信息

生成的 html 原始碼正確,並且顯示如預期的 Landscape 主題與顯示異常的 Keep 主題生成的 html 原始碼相同;因此我猜測是 css 方面的問題。

該段內容如下:

<h2 id="this-is-a-code-in-h2"><a href="#this-is-a-code-in-h2" class="headerlink" title="this is a code in h2"></a>this is a <code>code</code> in h2</h2>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions