Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature] `--no-code-tag-removal` flag allowing to make removal of backticks in TOC entries optional

Aperta
#153 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
markdown, shell
Ambito
cli, content

Direzione di ricerca

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``.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

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

  1. Reverting parts of 1056956, namely this line:

    https://github.com/ekalinin/github-markdown-toc/blob/0ccf70d0f49b61895f64bca86793ff8cdb88ad51/gh-md-toc#L280

    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.

  2. Adding a flag --remove-code-tags.

    While I find --remove-code-tags to 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-removal flag would change that, add backticks to the generated TOC entries again. --remove-code-tags would be the opposite, make code tags in the output the default (breaking change), allowing the user to opt out of this.

Lingua principale
Shell
Stelle
3.3k
Fork
2.7k
Merge medio
7m
PR unite (30g)
3

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ekalinin/github-markdown-toc

Tutte le issue di ekalinin/github-markdown-toc

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.