Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 当使用H1标题时,目录会变成cursor: text的样子,无法点击 #1134

Closed
Zrzzzz opened this issue Dec 29, 2022 · 7 comments

Comments

@Zrzzzz
Copy link

Zrzzzz commented Dec 29, 2022

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.5.1

是否修改过主题文件? || Has the theme files been modified?

不是 (No)

使用的瀏覽器? || What browse are you using?

Chrome

使用的系統? || What operating system are you using?

macOS

問題描述 | Describe the bug

image

即鼠标放到如图所示的地方,但使用H2 H3的都没问题

出現問題網站 | Website

https://www.zrzz.site/posts/95ef4eb4/

@jerryc127
Copy link
Owner

你用了第三方渲染插件吧
或者用了 hexo-toc ?

@Zrzzzz
Copy link
Author

Zrzzzz commented Dec 30, 2022

我重新在一个干净的目录中clone了butterfly主题,确实没有出现这个问题,但是我也没有使用hexo-toc,有什么办法可以检查这个问题吗。

@Zrzzzz
Copy link
Author

Zrzzzz commented Dec 30, 2022

这是我的package.json文件

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "6.3.0"
  },
  "dependencies": {
    "@neilsustc/markdown-it-katex": "^1.0.0",
    "hexo": "^6.3.0",
    "hexo-abbrlink": "^2.2.1",
    "hexo-browsersync": "^0.3.0",
    "hexo-deployer-git": "^3.0.0",
    "hexo-generator-archive": "^2.0.0",
    "hexo-generator-category": "^2.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-index": "^3.0.0",
    "hexo-generator-json-content": "^4.2.3",
    "hexo-generator-search": "^2.4.3",
    "hexo-generator-sitemap": "^3.0.1",
    "hexo-generator-tag": "^2.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-markdown-it": "^6.1.0",
    "hexo-renderer-pug": "^3.0.0",
    "hexo-renderer-stylus": "^2.1.0",
    "hexo-server": "^3.0.0",
    "hexo-util": "^3.0.1",
    "hexo-wordcount": "^6.0.1",
    "js-yaml": "^4.1.0"
  }
}

@jerryc127
Copy link
Owner

如果你是用 hexo-renderer-markdown-it

可以試下把這個 level 改爲 1

https://github.com/hexojs/hexo-renderer-markdown-it#automatic-headline-ids

markdown:
  anchors:
    # Minimum level for ID creation. (Ex. h2 to h6)
    level: 1
    # A suffix that is prepended to the number given if the ID is repeated.
    collisionSuffix: ''
    # If `true`, creates an anchor tag with a permalink besides the heading.
    permalink: false
    # Class used for the permalink anchor tag.
    permalinkClass: header-anchor
    # Set to 'right' to add permalink after heading
    permalinkSide: 'left'
    # The symbol used to make the permalink
    permalinkSymbol: ¶
    # Transform anchor to (1) lower case; (2) upper case
    case: 0
    # Replace space with a character
    separator: '-'

@Zrzzzz
Copy link
Author

Zrzzzz commented Dec 30, 2022

请问是在_config.yml中设置吗

markdown:
  anchors:
    # Minimum level for ID creation. (Ex. h2 to h6)
    level: 1
  plugins:
    - plugin:
      name: "@neilsustc/markdown-it-katex"
      options:
        strict: false

@jerryc127
Copy link
Owner

请问是在_config.yml中设置吗

markdown:
  anchors:
    # Minimum level for ID creation. (Ex. h2 to h6)
    level: 1
  plugins:
    - plugin:
      name: "@neilsustc/markdown-it-katex"
      options:
        strict: false

@Zrzzzz
Copy link
Author

Zrzzzz commented Dec 30, 2022

解决了,谢谢您,原来得hexo clean一下才生效

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants