nvda
9717b815 - QuickNav Text paragraph navigation (#16031)

Commit
2 years ago
QuickNav Text paragraph navigation (#16031) Closes #15998 Summary of the issue: Add QuickNav text paragraph navigation Description of user facing changes Added QuickNav gesture p to jump to next/previous text paragraph in browse mode. Description of development approach In BrowseModeTreeInterceptor added function _iterSimilarParagraph that finds next/previous paragraph that satisfies condition defined by a lambda function. I will reuse this function in later PRs to implement vertical navigation. Added a new clause in BrowseModeTreeInterceptor._quickNavScript() that handles text paragraph case and calls function defined in the previous bullet. For text criteria I ended up implementing a user configurable regex. Its initial value is defined in DEFAULT_TEXT_PARAGRAPH_REGEX variable in configSpec.py:11. It is user-configurable in Browse Mode page in NVDA options. The rationale for using a regex instead of plain-text search is to reduce the number of false positives. For example, for period character we check that it follows a word character \w and is followed by space character or end of string. There are a few more rules for edge cases in the code. I don't include comma, colon and semicolon punctuation marks in the regex due to high number of false positives. The regex also accounts for CJK languages by checking for full-width punctuation marks.
Author
Parents
Loading