GFM protocol autolink starts right after `<`, linking URLs inside non-autolink angle brackets

Abierto
#4,155 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

@EnesKartal ya está trabajando en esto.

Desde el 23/11/2026.

  • #4156 de @princejain756 — cerrado sin fusionar
  • #4279 de @EnesKartal — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript

Línea de trabajo

The report names marked.parse and says the lexer emits an incorrect link token; it does not identify a source file or test. Start by reading the handling of GFM protocol autolinks and the existing coverage for #4118. Add a regression case for <https://example.com/foo bar> and confirm it renders as plain text.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

works as intended

Marked version: 18.1.1
Markdown flavor: GitHub Flavored Markdown (default)

Description

Same root cause as #4118, but for the http:// / https:// case, which is still reproducible on 18.1.1. No existing issue that I could find for the protocol variant.

Expectation

<https://example.com/foo bar> is not a CommonMark autolink (link destinations can't contain spaces), and a GFM extended autolink "can only come at the beginning of a line, after whitespace, or any of the delimiting characters *, _, ~, and (" — < is not one of them. GitHub renders it as plain text:

<p>&lt;https://example.com/foo bar&gt;</p>

Result

marked.parse('<https://example.com/foo bar>')
<p>&lt;<a href="https://example.com/foo">https://example.com/foo</a> bar&gt;</p>

The lexer emits a link token with autolink: true for https://example.com/foo even though it directly follows <, so a chunk of a non-autolink gets linked and the link text misrepresents what was written (the bar> part is dropped from the link but the visible text suggests the whole bracket was a URL).

#4118 covered the www. case (<www.example.com>); the protocol case after < still links on 18.1.1.

Lenguaje dominante
TypeScript
Estrellas
37.3k
Forks
3.9k
Merge medio
5 d 6 h
PR fusionados (30 d)
62

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de markedjs/marked

Todos los issues de markedjs/marked

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.