developit / developit/snarkdown

Links inside bold/italic text result in invalid HTML

Aperta
#61 0 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.4k
Fork
116
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Links inside runs of bold or italic text are rendered as invalid HTML.

For example, the following Markdown:

```markdown
foo **[link](https://example.com)** bar
```

is rendered as:

```html
foo link bar
```

whilst the expected output would be:

```html
foo link bar
```

[More examples here](https://runkit.com/bock/5b0e748a072e510012552c4f).

Two things are unexpected here:

1. The output is invalid because the `` and `` tags are closed in the same order in which they're opened.
2. The `` tag is then re-opened and not closed until the end of the text, causing more of the text to be bold than intended.

The same happens when using `__` instead of `**`, as well as with italics (`_` or `*`).

When the formatting is _inside_ the link, the result is as expected:

```markdown
foo [**link**](https://example.com) bar
```

This renders as:

```html
foo
link bar
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia riproducendo gli esempi Markdown dell’issue nel parser JavaScript del repository e individua la gestione dei link annidati all’interno di sequenze in grassetto e corsivo. Confronta l’HTML generato con l’output previsto e verifica che gli stessi casi producano tag annidati correttamente, senza modificare la formattazione all’interno dei link.

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

Valutazione

Stack tecnologico
javascript
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.