Angle Brackets Bug
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia dal punto di ingresso markdown2.markdown e riproduci la stringa fornita con safe_mode="escape" e safe_mode="replace". Il lavoro è completato quando il blocco di codice C preserva il simbolo minore di e la citazione seguente viene resa come un Blockquote separato in entrambi i casi rilevanti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I noticed that in some scenarios, this bug can occur:
Suppose your string is the following:
>>> string = """
... Start of test.
...
... for (i=0; i<3; i++) {
... printf("Hello, world.");
... }
...
... > This is a quote
...
... End of test.
... """
I would expect the C-code snippet to be formatted as a code block, and the quote to be formatted as a blockquote.
However, when I use safe_mode="escape" (because I want users of this to be able to use HTML in the application), markdown2 thinks that there is a big HTML tag in this block from the less than symbol to the beginning of the blockquote:
>>> import markdown2
>>> markdown2.markdown(string, safe_mode="escape")
'<p>Start of test.</p>\n\n<pre><code>for (i=0; i<3; i++) {\n printf("Hello, world.");\n } \n\n> This is a quote\n</code></pre>\n\n<p>End of test.</p>\n'
>>> markdown2.markdown(string, safe_mode="replace")
'<p>Start of test.</p>\n\n<pre><code>for (i=0; i[HTML_REMOVED] This is a quote\n</code></pre>\n\n<p>End of test.</p>\n'
>>>
This seems to be a bug, because it means I cannot have a blockquote after a block of code that uses a < symbol.
- Lingua principale
- Python
- Stelle
- 2.8k
- Fork
- 459
- Merge medio
- 2g 19h
- PR unite (30g)
- 4
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
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 trentm/python-markdown2
-
Add py.typed marker Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
trentm/python-markdown2#696 ·
-
More XSS's in safe mode Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
trentm/python-markdown2#726 ·
-
Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
trentm/python-markdown2#707 ·
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
trentm/python-markdown2#688 · 4 commenti ·
-
Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
trentm/python-markdown2#679 · 2 commenti ·
Tutte le issue di trentm/python-markdown2
Issue simili
-
bug priority:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
CyberAgent/psd2svg#436 ·
-
area/install-update comp/cli comp/desktop P3 sweeper:risk-compatibility type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NousResearch/hermes-agent#122386 · 1 commento ·
-
ai-generated
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
vllm-project/production-stack#1105 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100