Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not detect correct boundary when speaking sentence in word-like documents #9002

Open
CyrilleB79 opened this issue Dec 2, 2018 · 5 comments

Comments

@CyrilleB79
Copy link
Collaborator

Steps to reproduce:

  • Open the attached file "Bug sentence nav.docx"
  • Press Alt+DownArrow many times to read the document sentence by sentence

Actual behavior:

The first sentence is not read since the caret is already at the beginning of the first sentence.
When you press 3 times Alt+DownArrow, the following sentences are read:

  • sentence 2
  • sentence 2 + sentence 3
  • sentence 4
    The caret however moves correctly at the beginning of each sentence, but on the second press, NVDA reads the sentence preceding the caret and the sentence just following the caret.

Expected behavior:

When you press 3 times Alt+DownArrow, the following sentences should be read:

  • sentence 2
  • sentence 3
  • sentence 4
    Since the caret moves correctly at the beginning of each sentence, on the second press, NVDA should read only the sentence just following the caret.

Additional comment

The issue seems due to the 0x0B characters present between sentence 2 and 3. This is a situation that happens frequently in e-mails in Outlook. Maybe depending on the client used to write the e-mail?

System configuration:

NVDA Installed/portable/running from source:

Installed

NVDA version:

2018.3.2

Windows version:

Version 10.0.17134 Numéro 17134

Name and version of other software in use when reproducing the issue:

Microsoft Word 2016, Microsoft Outlook 2016 (mail content)

Other information about your system:

N/A

Other questions:

Does the issue still occur after restarting your PC?

Yes

nvda.log
Bug sentence nav.docx
Bug sentence nav.docx

Have you tried any other versions of NVDA?

No

@CyrilleB79
Copy link
Collaborator Author

Adding attachments:
Bug sentence nav.docx
nvda.log

@CyrilleB79
Copy link
Collaborator Author

Re-poening issue, sorry for closing it erronously.

@CyrilleB79 CyrilleB79 reopened this Dec 2, 2018
@Adriani90
Copy link
Collaborator

Adriani90 commented May 10, 2020

This is happening because there is a soft return after sentence #2 which actually is a new line character. This is not a real line break, it just tells MS Word to go to the next line. See also
https://word.tips.net/T000170_Understanding_Hard_and_Soft_Returns.html
You can reproduce this if you press shift enter after sentence #1, then sentence #1 and sentence #2 will be spoken together when pressing alt+down arrow.
I think that NVDA's sentence rendering does not include soft line breaks yet, but if I am not wrong this should not be very difficult to fix.

@CyrilleB79
Copy link
Collaborator Author

@Adriani90 thanks for the link to the soft return, I did not understand how and why this character were inserted in some e-mails received by me.

To continue the analysis:

  1. The issue does not occur when there is one soft return at the end of the sentence, but two at least.
  2. It seems that the issue occurs when there is whichever combination of soft return (at least 2), spaces and no-break space between the previous sentence period and the next sentence first leter, and in whichever order.
  3. The issue is due to a MS Word bug. Indeed you can see it using the native extension mode. After having issued a sentence move command, you can press F8 3 times to select the current sentence. However, if you move from sentence 2 to sentence 3 with Alt+downArrow and then press 3 times F8, you will see that Sentence 2 and Sentence 3 are selected instead of sentence 3 only.
    Note: you need to press Escape to exit Word's extended selection mode.

@josephsl any thought on if it is useful to inform Microsoft of this issue, and if yes, how.

A solution to fix this issue would be to skip any space character (including soft and hard returns) after Word object model has returned the start position of the next sentence.
I already have a dirty try branch for this. If this solution is accepted, I can clean it and provide a PR for this.

@Adriani90
Copy link
Collaborator

cc: @mltony

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants