Skip to content

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

Description

@cxplay

在出现重复标题时, 意味着标题 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 开始计数的数字.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions