Numeric character references: Should HTML spec be followed for codes mapping to control characters
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- html, markdown
- Ambito
- documentation
Direzione di ricerca
Read the decimal numeric character references section in the CommonMark specification, then compare its stated behavior with the HTML numeric character reference rules and the linked commonmark.js and cmark implementations. The work is done when the project agrees whether the HTML replacement table is required or optional and the specification wording reflects that decision.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The spec says this:
Decimal numeric character references consist of
&#+ a string of 1--7 arabic digits +;.
A numeric character reference is parsed as the corresponding Unicode character.
Invalid Unicode code points will be replaced by the REPLACEMENT CHARACTER (U+FFFD).
For security reasons, the code pointU+0000will also be replaced byU+FFFD.
But note that commonmark.js doesn't actually follow that. Take – for example. In hex 150 is 96 which would map to U+0096, which is the (SPA) control character. However, it is converted to an en-dash –, see dingus.
The reason for this is that commonmark.js uses the entities package which implements the HTML spec. The HTML spec has a replacement table for certain characters, see parsing section:
If the number is one of the numbers in the first column of the following table, then find the row with that number in the first column, and set the character reference code to the number in the second column of that row.
Number Code point ... ... 0x96 0x2013 EN DASH (–) ... ...
(cmark behaves differently yet again, for certain code points, it uses a replacement character instead.)
Question: Should the spec prescribe the same mapping as the HTML spec? Or should it mention it and make it optional whether an implementation uses the replacement table or not?
(Originally raised here: https://github.com/commonmark/commonmark-java/issues/307#issuecomment-1974796674)
- Lingua principale
- Python
- Stelle
- 5.2k
- Fork
- 361
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di commonmark/commonmark-spec
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
commonmark/commonmark-spec#843 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
commonmark/commonmark-spec#838 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
commonmark/commonmark-spec#728 · 2 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
commonmark/commonmark-spec#848 · 4 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
commonmark/commonmark-spec#844 · 5 commenti · 1 reazione ·
Tutte le issue di commonmark/commonmark-spec
Issue simili
-
bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
mealie-recipes/mealie#9117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
freelawproject/courtlistener#8406 ·
I maintainer di solito rispondono entro 2 giorni
-
good first issue help wanted level 1 wocs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
GianlucaBave/murmury#49 ·
I maintainer di solito rispondono entro 1 giorno
-
regression skipped skipped_bmg
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
intel/torch-xpu-ops#6142 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
good first issue help wanted python up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
andrewsiah/agentswarm-data-tasks#122 ·
I maintainer di solito rispondono entro 1 giorno