Open naokazuterada opened 5 years ago
@naokazuterada, today I've encounted some more edge-case headings that required customizing my MarkdownTOC settings:
{
// remove trailing hyphens:
"pattern": "\\-+$",
"replacement": ""
},
{
// reduce consecutive hyphens:
"pattern": "\\-{2,}",
"replacement": "-"
},
Examples of headings that require this patterns:
heading | GitHub anchor |
---|---|
# Lang ( Go ) |
#lang-go |
without the above substitutions, the generated link would be #lang--go--
.
Possibly there might still be some edge-cases lurking in the dark — which only confirms that managing manual settings for all Git services is quite cumbersome, whereas having server configurations is going to make life much easier, especially with package updates fixing any new uncovered incompatiblity edge case.
@tajmone Thank you for the reference case. It was very valuable. I do not know that it will be possible with my effort to support all services, but I understood the importance of this feature. It would be able to obtain the required function by making the algorithm of ID conversion extensible and updating it little by little in the future. I agree. I take this into my TODO list. 👍
Purpose
Provide end users with easy configuration of configuration for various sites(GitHub, Gitlab, Bitbucket).
How important it is
Current configurations are complex.
Ref: https://github.com/naokazuterada/MarkdownTOC/issues/139#issuecomment-486988479
Ideal implementation
is shorthand for
Notes
compatibility
should contain not only 'attributes' setting but alsoid_replacements
setting.