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

支持自定义出现重复标题时的标题 ID 开始计数的数字 #196

Open
cxplay opened this issue Apr 20, 2023 · 1 comment
Open

Comments

@cxplay
Copy link

cxplay commented Apr 20, 2023

在出现重复标题时, 意味着标题 ID 也会重复, 但标题重复是正常的, 标题 ID 不能重复. 于是在定义重复标题 ID 开始计数的数字时出现了分歧:

在 VS Code, 由 IntelliSense 提供支持的 Markdown 自动路径补全中, 对于出现重复标题的开始计数的数字是 1; 但是当前
hexo-renderer-markdown-it 开始计数的数字默认是 2.

例如存在如下的 Markdown 源代码:

## title 
### title
#### title

那么 VS Code 可用于自动补全的提示会是:

#title
#title-1
#title-2

image

但是经过 hexo-renderer-markdown-it 渲染后的标题 ID 会是, 不存在 title-1:

#title
#title-2
#title-3

image


因此, 希望能够支持自定义 anchor 选项中对于重复标题的标题 ID 开始计数的数字.

@cxplay
Copy link
Author

cxplay commented Apr 20, 2023

此外, 对于重复的标题 ID 是应该在第二次出现开始加入编号, 还是从第一个标题 ID 就给予编号也应该能够实现自定义.

某些编辑器中如果出现重复标题 ID, 则中从第一个就会开始编号计数:

#title-1
#title-2
#title-3

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

1 participant