[Feature] `--no-code-tag-removal` flag allowing to make removal of backticks in TOC entries optional
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
Research direction
Start at the gh-md-toc logic around line 280 referenced in the issue, then trace how CLI flags are parsed and how generated TOC entries are formatted. Add the optional flag so code tags remain when requested, while preserving the current default behavior; verify the output for a heading such as # Headline``.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
CI in one of my projects started failing, because the generated TOC entries did not contain backticks. I.e. a headline:
# `Headline`
becomes a TOC entry
* [Headline](#headline)
Note the missing backticks ` in the generated TOC entry. My linter didn't like that and started failing CI.
Describe the solution you'd like
I'd like to have the option to generate a TOC entry:
* [`Headline`](#headline)
with the backticks present.
For this I propose a new CLI flag --no-code-tag-removal that when present disables the current logic removing the generated <code> and </code> tags and instead replaces them with a backtick again.
Describe alternatives you've considered
-
Reverting parts of 1056956, namely this line:
While I believe this was a rather arbitrary change of logic in response to #13, it would still be a breaking change just to revert it. There might be users that want backticks to be removed from the TOC.
-
Adding a flag
--remove-code-tags.While I find
--remove-code-tagsto be a better name than--no-code-tag-removal, it would reverse the logic of code tag removal and become a breaking change again, just like the first considered alternative. I.e. now the default is that backticks are removed. The proposed--no-code-tag-removalflag would change that, add backticks to the generated TOC entries again.--remove-code-tagswould be the opposite, make code tags in the output the default (breaking change), allowing the user to opt out of this.
- Dominant language
- Shell
- Stars
- 3.3k
- Forks
- 2.7k
- Avg merge
- 7m
- Merged PRs (30d)
- 3
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ekalinin/github-markdown-toc
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ekalinin/github-markdown-toc#167 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ekalinin/github-markdown-toc#165 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ekalinin/github-markdown-toc#152 · 1 reaction ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ekalinin/github-markdown-toc#141 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
ekalinin/github-markdown-toc#139 ·
All issues in ekalinin/github-markdown-toc
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
backlog bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
WLAN-Pi/wlanpi-profiler#306 ·
Maintainers usually reply within 1 day
-
area: backend good first issue priority: P3 - low size: S type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Mizithra/ActiveTerrain#31 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
obra/superpowers#2422 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ComplianceAsCode/content#15152 ·
Maintainers usually reply within 3 days