Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Bold/emphasis fails when closing delimiter is preceded by a closing bracket and followed by a non-punctuation character

Abierto
#840 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
markdown

Línea de trabajo

Start with CommonMark spec §6.2 and reproduce the examples using the GitHub Markdown API command in the issue. Compare the delimiter rules for closing punctuation against the listed expected and actual results. Done means reaching agreement on the proposed Unicode Pe rule and updating the relevant specification behavior and coverage.

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

Descripción

Summary

Strong emphasis (bold) is not rendered when a ** closing delimiter is
immediately preceded by a closing bracket (e.g. ), ], ") and followed
by a non-punctuation, non-whitespace character such as a letter or digit.

Reproduction

Verified on GitHub.com via the Markdown API:

curl -s -X POST \
  -H "Content-Type: application/json" \
  -d '{"text": "**)**a\n", "mode": "gfm"}' \
  https://api.github.com/markdown
# => <p>**)**a</p>   ← not bold
Input Expected Actual
**)**a **)**a (bold) **)**a (literal)
**)**1 **)**1 (bold) **)**1 (literal)
**]**a **]**a (bold) **]**a (literal)
**"**a **"**a (bold) **"**a (literal)
**)**! )! (bold) ✅ correct
**)** a )·a (bold) ✅ correct (with space)

Root Cause

The CommonMark spec §6.2 defines a right-flanking delimiter run as:

(1) not preceded by Unicode whitespace, and
(2a) not preceded by a Unicode punctuation character, OR
(2b) preceded by a Unicode punctuation character AND followed by
Unicode whitespace or a Unicode punctuation character.

For **)**a, the closing ** has:

  • before = ) → unicode.IsPunct = true
  • after = a → neither whitespace nor punctuation

Applying the rule:
!false && (!true || false || false) = false
→ The closing ** is not right-flanking → bold is not rendered.

Why this is a spec issue

Closing brackets (Unicode category Pe: ), ], }, ", », etc.)
are punctuation by Unicode definition, yet they are semantically
word-terminating — the character following them is logically separate
from the bracketed content. The current rule treats them the same as
opening punctuation like ( or ", which causes the asymmetry:

**(note)**  is bold   ✅  (after = space)
**(note)**. is bold   ✅  (after = punctuation)
**(note)**a is NOT    ❌  (after = letter)

This is counterintuitive: a user writing see **(RFC 9110)**section 5
would reasonably expect bold to apply.

Suggested fix

Amend condition (2b) to exclude closing punctuation (Unicode category Pe)
from the "preceded by punctuation" restriction:

(2b) preceded by a Unicode punctuation character other than a closing
bracket (category Pe)
, AND followed by Unicode whitespace or
a Unicode punctuation character.

Or equivalently: treat Unicode Pe characters as non-punctuation for the
purpose of the right-flanking delimiter rule only.

References

Lenguaje dominante
Python
Estrellas
5.2k
Forks
360
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 commonmark/commonmark-spec

Todos los issues de commonmark/commonmark-spec

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.