Skip to content

Commit

Permalink
Return "blank" if text empty after processing
Browse files Browse the repository at this point in the history
closes nvaccess#13431 (yay! a palindrome)
  • Loading branch information
SamKacer committed Apr 24, 2022
1 parent ef31b1d commit b3e13c2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/speech/speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ def isBlank(text):

RE_CONVERT_WHITESPACE = re.compile("[\0\r\n]")

def processText(locale,text,symbolLevel):
def processText(locale, text, symbolLevel):
text = speechDictHandler.processText(text)
text = characterProcessing.processSpeechSymbols(locale, text, symbolLevel)
text = RE_CONVERT_WHITESPACE.sub(u" ", text)
return text.strip()
# if text is empty after processing, return blank instead
# Translators: This is spoken when the text is empty
return text.strip() or _("blank")

def cancelSpeech():
"""Interupts the synthesizer from currently speaking"""
Expand Down

0 comments on commit b3e13c2

Please sign in to comment.