Code spans that wrap onto the next line are no longer recognised (regression from the #702 fix)
Maintainer antworten meist innerhalb von 3 Tagen
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
Rechercherichtung
Start by reading _code_span_re and the #702 change that removed re.S, then trace the related safe mode handling described in the issue. Check how code spans with line endings are parsed and how safe_mode="escape" and safe_mode="replace" behave. Done means wrapped code spans are recognized while the #702 safety handling remains correct.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Since 69635a9 (the fix for #702), a code span that wraps onto the next line is no longer recognised. This is common in hard-wrapped docs:
>>> markdown2.markdown("Call the `foo\nbar()` function.")
'<p>Call the `foo\nbar()` function.</p>\n'
Before that commit, the same input gave:
'<p>Call the <code>foo\nbar()</code> function.</p>\n'
The commit removed re.S from _code_span_re, so . in the pattern no longer matches the line ending. As far as I can tell this hasn't been released yet (it's after 2.5.5), so it might be worth sorting out before the next release.
Code spans can contain line endings in Markdown.pl and in CommonMark (spec, 6.1, where line endings are turned into spaces), so this looks unintended.
Simply putting re.S back doesn't seem right either. It doesn't bring back an executable XSS (the #702 example comes out escaped in safe_mode="escape"), but in safe_mode="replace" the tag is escaped instead of replaced. So the fix probably needs to happen together with the #702 handling. I didn't want to guess at the intended approach, so I'm opening this as an issue instead of a PR.
- Vorherrschende Sprache
- Python
- Sterne
- 2.8k
- Forks
- 477
- Ø Merge
- 4 T. 10 Std.
- Gemergte PRs (30 T.)
- 12
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus trentm/python-markdown2
-
Add py.typed markerEvtl. vergeben @mac-agent hat das vor 219 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
trentm/python-markdown2#696 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
link-patterns extra replaces matches inside inline HTML tags and destroys email auto-linksEvtl. vergeben @rahul05ranjan hat das vor 5 Tagen übernommen. OffenBug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 30/100
trentm/python-markdown2#752 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Quadratic-time inline-link parsing: many unclosed [...]( cause a CPU DoSEvtl. vergeben @ParamTanna hat das vor 6 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
trentm/python-markdown2#750 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
trentm/python-markdown2#688 · 4 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
trentm/python-markdown2#679 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in trentm/python-markdown2
Ähnliche Issues
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesOffenfollow-up
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Built-in QUBO fallback applies bitwise xor to floating binary statesEvtl. vergeben @iloveeyjafjalla hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
qboson/kaiwu-pytorch-plugin#1702 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
bug v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
modelcontextprotocol/python-sdk#3811 ·
Maintainer antworten meist innerhalb von 1 Tag
-
cost:cheap practicality:seen-in-the-wild severity:medium
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Maintainer antworten meist innerhalb von 1 Tag