[ BUG ] TOC entry text keeps the HTML of links, images and formatting in a heading
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 83/100
Direzione di ricerca
La issue indica internal/utils/utils.go e internal/adapters/tocgrabber_re.go; inizia leggendo Utils.RemoveStuff e RegexpExtractor.Extract, poi confronta l’output grezzo dell’URL con gli esempi previsti. Il lavoro è completato quando il testo delle voci del TOC rimuove i tag HTML mantenendone il testo interno e le entità già renderizzate, senza modificare gli anchor. Secondo la issue, il percorso dell’URL del blob non è interessato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
For a local file, STDIN or a raw URL, the text of a TOC entry is the HTML that GitHub
renders for the heading, with only <code> removed. A heading with a link, an image,
emphasis or inline HTML gives an entry with tags in its text. The anchors are correct.
The Bash version had the same bug (ekalinin/github-markdown-toc#40,
ekalinin/github-markdown-toc#67) and fixed it in ekalinin/github-markdown-toc#185.
To Reproduce
The test file of the Bash version:
gh-md-toc --hide-header --hide-footer "https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/tests/test%20directory/test_headingmarkup.md"
Actual:
* [Top](#top)
* [On <sub><sub><a href="\#top">Go to Top</a></sub></sub>](#on-go-to-top)
* [<a href="https://github\.com/ekalinin/github\-markdown\-toc/issues/67">My issue</a>](#my-issue)
* [See <a href="\#top">docs</a> here](#see-docs-here)
* [Linux vs\. Samba <em><strong>permissions</strong></em>](#linux-vs-samba-permissions)
* [A <a target="\_blank" rel="noopener noreferrer" href="x\.png"><img src="x\.png" alt="img" style="max\-width: 100%;"></a> B](#a--b)
* [Tom & Jerry <3](#tom--jerry-3)
Expected behavior
All HTML tags are removed, the text inside them is kept, and HTML entities stay as GitHub
renders them, as in the Bash version:
* [Top](#top)
* [On Go to Top](#on-go-to-top)
* [My issue](#my-issue)
* [See docs here](#see-docs-here)
* [Linux vs\. Samba permissions](#linux-vs-samba-permissions)
* [A B](#a--b)
* [Tom & Jerry <3](#tom--jerry-3)
Environment (please complete the following information):
- OS: macOS (darwin/arm64)
- Version: 2.0.1, current
master(dd680f7)
Additional context
utils.RemoveStuff(internal/utils/utils.go) removes only<code>and</code>. It
is applied to the heading text inRegexpExtractor.Extract
(internal/adapters/tocgrabber_re.go).- The blob URL of the same file is not affected: its text comes from the JSON payload
(JSONExtractor).
- Lingua principale
- Go
- Stelle
- 525
- Fork
- 89
- Merge medio
- 6m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ekalinin/github-markdown-toc.go
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Tutte le issue di ekalinin/github-markdown-toc.go
Issue simili
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeoutForse già presa @floriankoch l’ha presa oggi. Apertatriage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
envoyproxy/gateway#10562 ·
I maintainer di solito rispondono entro 1 giorno
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"Forse già presa @Daksha1611 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
[Bug] K8s reconcile still resets explicit 0 to defaults for response_api, memory and flow stateForse già presa @Bevisy l’ha presa oggi. Apertaneeds-acceptance
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
vllm-project/semantic-router#5998 ·
I maintainer di solito rispondono entro 2 giorni