diff --git a/src/fenrirscreenreader/core/outputManager.py b/src/fenrirscreenreader/core/outputManager.py index 44555e62..68e5690a 100644 --- a/src/fenrirscreenreader/core/outputManager.py +++ b/src/fenrirscreenreader/core/outputManager.py @@ -77,6 +77,27 @@ class OutputManager: def get_last_echo(self): return self.last_echo + def process_mid_word_punctuation(self, text): + """ + Process punctuation that appears mid-word to ensure proper pronunciation. + Specifically handles dots between word characters (e.g., "settings.conf" -> "settings dot conf") + and dots at word beginnings (e.g., ".local" -> "dot local") + while preserving sentence-ending periods and other punctuation behavior. + """ + if not text: + return text + + # Handle dots at the beginning of words (like .local, .bashrc, .config) + # Look for non-word character (or start of string), dot, then word characters + text = re.sub(r'(?