Second code span not recognised after an unclosed backtick string and another code span
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start with the Java Parser and HtmlRenderer example in the issue and reproduce the three input strings against current main. Add regression coverage for the unclosed double-backtick input alongside the neighbouring code spans, and verify that the rendered HTML matches the expected output.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Steps to reproduce the problem (provide example Markdown if applicable):
`` `a` `c`
The same through the API, with two neighbouring inputs that render correctly, to show the trigger:
import org.commonmark.parser.Parser;
import org.commonmark.renderer.html.HtmlRenderer;
public class Main {
public static void main(String[] args) {
Parser parser = Parser.builder().build();
HtmlRenderer renderer = HtmlRenderer.builder().build();
for (String md : new String[] {"`` `a` `c`", "`` `a`", "`a` `c`"}) {
System.out.print(md + " -> " + renderer.render(parser.parse(md)));
}
}
}
Expected behavior:
<p>`` <code>a</code> <code>c</code></p>
This is what the reference implementation, commonmark.js 0.31.2, gives for all three inputs: the `` has no
closing double backtick and stays literal, and both `a` and `c` are code spans (spec 0.31.2, Code spans).
Actual behavior:
<p>`` <code>a</code> `c`</p>
The full output of the program above:
`` `a` `c` -> <p>`` <code>a</code> `c`</p>
`` `a` -> <p>`` <code>a</code></p>
`a` `c` -> <p><code>a</code> <code>c</code></p>
The second code span, `c`, is left as text. It takes all three parts: with only the unclosed `` and one
code span, or with the two code spans and no unclosed string, the output is correct. Text between the parts changes
nothing, and every further code span of the same length stays text too: `a` `c` `e` after the unclosed string
gives <code>a</code> `c` `e`.
Tested on commonmark 0.30.0 from Maven Central and on current main (b89e72f).
BTW, this was found by an automated program that writes property-based tests for various open source projects using hegel (but it has been reviewed by hand before reporting). We've also potentially found (but not yet hand validated) 51 other bugs in commonmark-java. You can see the tests at https://github.com/hegeldev/hegel-zoo/tree/main/targets/java/commonmark-java. Let us know if you would like us to file the other bugs found and/or contribute the tests. NB the tests are currently LLM generated and probably not yet suitable for inclusion as is, but we're happy to help get them into a better state if you want them.
- Lenguaje dominante
- Java
- Estrellas
- 2.7k
- Forks
- 336
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 commonmark/commonmark-java
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
commonmark/commonmark-java#460 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 74/100
commonmark/commonmark-java#457 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 48/100
commonmark/commonmark-java#443 · 4 comentarios ·
-
Option to define custom flanking/canOpen/canClose rules for delimitersQuizá libre de nuevo @abhiramaab la tomó hace 57 días y no hay ningún pull request abierto. Abiertoenhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
commonmark/commonmark-java#428 · 4 comentarios ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
commonmark/commonmark-java#414 · 1 comentario · 1 reacción ·
Todos los issues de commonmark/commonmark-java
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
waiting-for-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
spring-cloud/spring-cloud-openfeign#1443 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
ADORSYS-GIS/keycloak-oid4vp-plugin#221 ·
Los mantenedores suelen responder en 2 días
-
Upgrade to Spring Pulsar 2.0.8Abiertostatus: team-only type: dependency-upgrade
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
spring-projects/spring-boot#52099 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
tchiotludo/akhq#3307 · 1 reacción ·
Los mantenedores suelen responder en 1 día