Search highlighting shows stray backslashes, misses bracketed matches, and can crash
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 0
- Forks
- 2
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
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 lanl/chatty
-
area: rag bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día
-
area: client bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area: ui bug wrong-result
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
area: config bug wrong-result
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
area: config bug wrong-result
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
Todos los issues de lanl/chatty
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
software-mansion-labs/Diplomat#20 ·
Los mantenedores suelen responder en 1 día
-
[Windows] Hidden title bar: a maximized window restored from minimized on a secondary monitor gets the primary monitor's work area as its client areaPosiblemente ocupada @lijy91 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
libnativeapi/nativeapi#53 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
View Counts discarded due to field name mismatchPosiblemente ocupada @rsiva0400 la tomó hoy. Abiertosite-bug triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Model version publishes the new UK firm entity as a personPosiblemente ocupada @vahid-ahmadi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolicyEngine/policyengine.py#764 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
spcl/HPCAgent-Bench#264 ·
Los mantenedores suelen responder en 1 día