Increase Precedence of shortcut link references over full and compact for defined link references
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- markdown
- Área
- documentation
Línea de trabajo
Start with the linked discussion and the spec.txt sections for Examples 561 and 567, then compare their current and desired outputs. Review the footnote example as an additional precedence case. Done means the specification and relevant reference behavior consistently reflect the requested precedence without changing unresolved ambiguities.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Followup to this discussion as well as yuin/goldmark#143. The idea is to give higher precedence to shortcut link references when they actually resolve to a link defined in the document, so as to give priority to the links as defined by the author, rather than to the rules for parsing the links references themselves. Where ambiguity cannot be resolved by link definitions, the precedence should be as before. Examples follow.
Example 561
[foo][bar]
[foo]: /url1
[bar]: /url2
Current output:
<p><a href="/url2">foo</a></p>
Desired output:
<p><a href="/url1">foo</a><a href="/url2">bar</a></p>
Reason: The author has made explicit definitions for the foo and bar links, so both should take precedence over [foo][bar], as it's more likely to reflect the author's intent.
Example 567
[foo][bar][baz]
[baz]: /url1
[foo]: /url2
Current output:
<p>[foo]<a href="/url1">bar</a></p>
Desired output:
<p><a href="/url2">foo</a><a href="/url1">bar</a></p>
Reason: The author has made explicit definitions for the baz and foo links but not bar, so [foo] and [bar] should take precedence over [bar][baz], as it's more likely to reflect the author's intent.
Footnote Example
Visit [Foo][^1].
[Foo]: https://example.com/
[^1]: But not really
Current output:
<p>Visit [Foo]<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>But not really <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
Desired output:
<p>Visit <a href="https://example.com/">Foo</a><sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup>.</p>
<hr class="footnotes-sep">
<section class="footnotes">
<ol class="footnotes-list">
<li id="fn1" class="footnote-item"><p>But not really <a href="#fnref1" class="footnote-backref">↩︎</a></p>
</li>
</ol>
</section>
Reason: The author has made explicit definitions for both the [Foo] link and the [^1] footnote, so both should be rendered, rather than prioritizing [Foo][^1] as a full reference, especially since [^1] fails to resolve to a link at all. Again, the intention here is to better approximate the likely intent of the author. (I realize that CM does not define a footnote syntax, but I suspect it its CM's precedence rules that interfere with the expected footnote output.)
- 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
- 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-spec
-
NBSP written two different waysAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
commonmark/commonmark-spec#843 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
commonmark/commonmark-spec#838 · 2 comentarios ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
commonmark/commonmark-spec#728 · 2 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
commonmark/commonmark-spec#844 · 5 comentarios · 1 reacción ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
commonmark/commonmark-spec#842 ·
Todos los issues de commonmark/commonmark-spec
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
zach-blumenfeld/aip#13 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
nathanmarlor/foxess_modbus#1287 ·
Los mantenedores suelen responder en 4 días
-
bug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
OpenLakeForge/openlakeforge#498 ·
Los mantenedores suelen responder en 1 día
-
good first issue hacktoberfest help wanted python
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
Exact onnxruntime==1.27.0 core pin makes Pipecat-based apps uninstallable from the dashboardAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
pollen-robotics/reachy_mini#1493 ·
Los mantenedores suelen responder en 1 día