Navigation: ZoomIn fails when the first child says nothing (silent or invisible)
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- accessibility
Direzione di ricerca
Start from do_navigate_command_string and apply_navigation_rules in the Rust navigation code, especially the LOOP_LIMIT retry loop for ZoomIn/ZoomInAll. Reproduce with the silent-separator example from the issue, then try switching the retry command to MoveNext and confirm ZoomIn lands on the next spoken node. Run cargo test and check the Enhanced-mode ZoomIn cases; done means the example speaks "x plus 1" and silent-node failures drop without regressing other navigation commands.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
ZoomIn and ZoomInAll fail if they land on a node that produces no speech, such as an invisible separator with :silent:
<math><mi intent=":silent">⁣</mi><mi>x</mi><mo>+</mo><mn>1</mn></math>
Reading gives "x plus 1", but ZoomIn gives "Internal error: Navigation exceeded limit of number of times no speech generated" (MathCAT Demo: "Error in Navigation"). The same happens with a plain <mi>⁣</mi>, and in every language.
This matters for LaTeX: the spanish-mathml-intent package puts these silent separators in most of its output. In its 579 test formulas (tagged PDFs, mathml-SE), ZoomIn fails in 480 of them in Enhanced mode.
The cause: when a command produces no speech, do_navigate_command_string retries the same command. ZoomIn from a leaf stays on that leaf, so all three tries say nothing. A possible fix is to retry with MoveNext after ZoomIn/ZoomInAll:
for loop_count in 0..LOOP_LIMIT {
- let (speech, done) = apply_navigation_rules(mathml, nav_command, &rules, &mut rules_with_context, &mut nav_state, loop_count)?;
+ // If zooming in landed on a node that says nothing (e.g., a silent invisible separator), move on to the next node
+ let command = if loop_count > 0 && (nav_command == "ZoomIn" || nav_command == "ZoomInAll") {"MoveNext"} else {nav_command};
+ if command != nav_command {
+ rules_with_context.get_context().set_variable("NavCommand", command);
+ }
+ let (speech, done) = apply_navigation_rules(mathml, command, &rules, &mut rules_with_context, &mut nav_state, loop_count)?;
With this change, the example zooms in to "x plus 1" (the next node at that level), cargo test passes, and the failures in Enhanced mode drop from 480 to 44. Forty of those are examples that are completely silenced on purpose, so there is nothing to say. Maybe you prefer to skip silent nodes in the navigation rules instead; this is only a suggestion.
- Lingua principale
- Rust
- Stelle
- 131
- Fork
- 97
- Merge medio
- 21h 45m
- PR unite (30g)
- 95
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 daisy/MathCAT
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di daisy/MathCAT
Issue simili
-
area:schema documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
ElectronicWave/Elemental#252 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dekobon/big-code-analysis#1887 ·
I maintainer di solito rispondono entro 1 giorno
-
Shell中文符号输入异常Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno