Code span inside link text drops the backslash or ends the link early (\], \[, backtick)
Los mantenedores suelen responder en 4 días
@hakarrr ya está trabajando en esto.
Desde el 9/11/2026.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- tooling
Línea de trabajo
Start by running the three inputs in the issue through new Marked().parse(input) and comparing them with the expected <a> and <code> output. The payload names no source files, so locate the inline rules that handle code spans and link brackets, and check which one wins when a code span sits inside link text. Done when all three cases match the CommonMark output, with backslashes kept literal inside <code> and the second link in case 3 parsed separately.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Marked version: 18.1.2
Describe the bug
A code span inside link text loses its literal backslash, or ends the link early, when its content contains a backslash, a square bracket or a backtick. In CommonMark, code span content is literal (no backslash escapes), and code spans bind more tightly than link brackets.
To Reproduce
Unmodified new Marked().parse(input); the trailing newline is omitted from the output.
1. Input: [`\]`](https://x.test/)
Expected: <p><a href="https://x.test/"><code>\]</code></a></p>
Actual: <p><a href="https://x.test/"><code>]</code></a></p>
2. Input: [`\[`](https://x.test/)
Expected: <p><a href="https://x.test/"><code>\[</code></a></p>
Actual: <p><a href="https://x.test/"><code>[</code></a></p>
3. Input: [`` ` ``](https://x.test/)[\`](https://x.test/)
Expected: <p><a href="https://x.test/"><code>`</code></a><a href="https://x.test/">`</a></p>
Actual: <p><a href="https://x.test/"><code>`</code>](https://x.test/)[`</a></p>
Expected behavior
Matches the CommonMark reference implementation: the code span's content stays literal inside link text, and the second link in case 3 is parsed separately.
Found with a property test over generated Markdown. The class is narrow: a code span inside link text whose content has a backtick, backslash or square bracket. Happy to test a fix.
- Lenguaje dominante
- TypeScript
- Estrellas
- 37.3k
- Forks
- 3.9k
- Merge medio
- 5 d 6 h
- PR fusionados (30 d)
- 62
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de markedjs/marked
-
Inline raw HTML is escaped after an unclosed `_` / `*` / `~` (regression in 18.2.1)Posiblemente ocupada @O1sumitkumar la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 4 días
-
Lazy continuation line inside a quoted list item is parsed as a nested listPosiblemente ocupada @amstedy la tomó hace 1 día. AbiertoL2 - annoying
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
markedjs/marked#4293 · 2 comentarios ·
Los mantenedores suelen responder en 4 días
-
Deeply nested emphasis is quadratic and overflows the stack in the lexerPosiblemente ocupada @Pastalikek65 la tomó hace 5 días. Abiertocategory: inline elements L2 - annoying
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
markedjs/marked#4286 · 1 comentario ·
Los mantenedores suelen responder en 4 días
-
proposal
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
markedjs/marked#4282 · 8 comentarios ·
Los mantenedores suelen responder en 4 días
-
Quadratic time in the inline `text` rule: its email look-ahead rereads the rest of the paragraphPosiblemente ocupada @yxshee la tomó hace 10 días. AbiertoL2 - annoying
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 4 días
Todos los issues de markedjs/marked
Issues similares
-
Media browser returns "Not found" for repositories using the SHA-256 object formatPosiblemente ocupada @adamchodera la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Follow-ups from #312Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
janhesters/remixcn#318 ·
Los mantenedores suelen responder en 1 día
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
danielmiessler/LifeOS#3150 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Make the "%" unit spacing the same in the web and in A10Posiblemente ocupada @kragent66-glitch la tomó hoy. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comentario ·