Search highlighting shows stray backslashes, misses bracketed matches, and can crash
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Start in src/chatty/ui/widgets.py at MessageWidget._apply_highlight (around line 163) and read issue #1, which is linked as related work. Check how the search handler calls this method and run the existing search/highlighting tests. Done means highlights use Content.stylize("reverse", start, end), bracketed and backslash-adjacent matches work, and searching no longer crashes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
MessageWidget._apply_highlight (src/chatty/ui/widgets.py:163) tries to protect brackets with text.replace("[", r"\[").replace("]", r"\]") before inserting [reverse]...[/reverse] around each match. This is wrong in three ways:
\]is not a Textual escape, so it shows as a literal backslash. SearchinghivinSee [1.3] and HIVdisplaysSee [1.3\] and HIV.- Escaping happens before the search, so match positions refer to the escaped text. Searching
[1.3]counts the message as a match but highlights nothing. - A match right after a backslash escapes the opening tag. Searching
bina\bproducesa\[reverse]b[/reverse], and searching]in any message with brackets produces the same pattern. Both raiseMarkupError: auto closing tag ('[/]') has nothing to closefrom the search handler, and the app exits.
Fix: build the highlighted text as Content and apply Content.stylize("reverse", start, end) at the match positions, which never parses the message as markup. Fix this together with #1, which removes markup parsing from the rest of MessageWidget.
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 2
- Merge medio
- 1g 4h
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 lanl/chatty
-
area: rag bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
area: client bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
area: ui bug wrong-result
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
area: config bug wrong-result
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
area: config bug wrong-result
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
software-mansion-labs/Diplomat#20 ·
I maintainer di solito rispondono entro 1 giorno
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaForse già presa @lijy91 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
libnativeapi/nativeapi#53 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
View Counts discarded due to field name mismatchForse già presa @rsiva0400 l’ha presa oggi. Apertasite-bug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Model version publishes the new UK firm entity as a personForse già presa @vahid-ahmadi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
PolicyEngine/policyengine.py#764 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
spcl/HPCAgent-Bench#264 ·
I maintainer di solito rispondono entro 1 giorno