-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
修改heading的id的生成方式 #503
Comments
我都是直接指定文件的英文名字,感觉不是很需要 |
zhipengyan
pushed a commit
to zhipengyan/hexo
that referenced
this issue
Apr 4, 2016
同pull request hexojs#443
请问如何指定? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
目前markdown的renderer会为文章中的每个heading生成id,在heading内容为拉丁语的时候没有任何问题,但若为其它多字节语言(如汉语)时,生成的id仅为“-”,这是由于javascript的正则匹配的问题,但在utf8编码的情况下,中文这样的多字节语言也同样可以作为标签的id,包括一些特殊符号,为了提高通用性和方便页面内导航,建设修改生成规则,拿掉目前的多种判断方式,仅需替换空格为“-”,虽然在这样heading的id比较混乱,但对于使用是有利的。目前我的处理方式是写一个插件覆盖库中的工作方式:
经过这样的处理,目前heading为中文、英文及中英文符号时均能正常工作!
The text was updated successfully, but these errors were encountered: