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

vitepress中使用中文锚点时,控制台会报错 #1513

Closed
3 tasks done
gezhicui opened this issue Oct 20, 2022 · 2 comments
Closed
3 tasks done

vitepress中使用中文锚点时,控制台会报错 #1513

gezhicui opened this issue Oct 20, 2022 · 2 comments
Labels
need more info Further information is requested

Comments

@gezhicui
Copy link

Describe the bug

在md文件中,标题为中文时,点击文章左侧的锚点跳转报错

报错内容:app.64b74b54.js:1 DOMException: Failed to execute 'querySelector' on 'Document': '#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8' is not a valid selector.

image

Reproduction

1、新建一个md文章
2、一级标题# 二级标题## 设置为中文
3、启动vitepress,点击左侧锚点
4、控制台查看报错

Expected behavior

控制台正常不报错

System Info

浏览器:Google Chrome v106
vitepress: "1.0.0-alpha.4"

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@gezhicui gezhicui added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 20, 2022
@brc-dd
Copy link
Member

brc-dd commented Oct 20, 2022

Can you try updating your VitePress version? IIRC this was fixed earlier (#951?)

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Oct 20, 2022
@gezhicui
Copy link
Author

I solved the problem in the way you said ,thanks!!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants