On Tue, 8 Oct 2019, Brian Vogel wrote:
This conversation interests me because it seems to me that two different things are being talked about.Luke's solution uses a regular expression where theWhat you appear to be missing, are the dynamics of the available solutions.
Sure, if we had the option of running some kind of preprocessing filter on the text before NVDA converted it to speech, we could use a regexp like the one you suggest. But have you actually tried it? I suspect if you had, you would have found that it has no effect what so ever.
That is because we don't have that preprocessing option, short of writing an add-on for this strange purpose.
What we do have available, are speech dictionaries. But with that we have a problem, because by the time the dictionaries get applied, it's far too late in the process to even see the original text. All we get to work with is a layer between the text that is going to be sent to a synth, and the text that actually arrives at a synth.
We are doing post-processing transforms on *output* not input.
How does one tell a synth to indicate a blank line? If you just send \n, or \r\n, or their ASCII control code equivalents, it will likely say nothing. The way you (NVDA) get it to say something, is to substitute the word "blank", or the locale equivalent. So that, and only that, is what we are left with intercepting and modifying or suppressing.
Now using the regular expression: ^\s*$with nothing substituted for it should find any line that is blank, whether it's just someone having hit Enter, or any whitespace character followed by enter, and would say nothing if that's found.Of course, if we were able to preprocess the text before NVDA's translation layers got their hooks into it, but we can't.
If the literal word "blank" were toTo be clear, I was answering the question, not stating an opinion on the advisability of doing this. Which opinion is: don't, it's not worth it. But hey, to each his own.