diff --git a/CHANGELOG.md b/CHANGELOG.md index d3ecf8c..468d0b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.1.9 +- Fixed the issue where spaces were deleted before punctuation marks while generating subtitles. + # 1.1.8 - Added `.md` (Markdown) file extension support by @brianxiadong in PR #75 - Added new option `Configure silence between chapters` that lets you configure the silence between chapters, mentioned by @lfperez1982 in #79 diff --git a/abogen/conversion.py b/abogen/conversion.py index 8aa0530..df04f28 100644 --- a/abogen/conversion.py +++ b/abogen/conversion.py @@ -1188,24 +1188,8 @@ class ConversionThread(QThread): """Helper function to process subtitle tokens according to the subtitle mode""" if not tokens_with_timestamps: return - - # Always combine punctuation with preceding words for consistent handling across modes - processed_tokens = [] - i = 0 - while i < len(tokens_with_timestamps): - token = tokens_with_timestamps[i].copy() - - # Look ahead for punctuation - while i + 1 < len(tokens_with_timestamps) and re.match( - r"^[^\w\s]+$", tokens_with_timestamps[i + 1]["text"] - ): - token["text"] += tokens_with_timestamps[i + 1]["text"] - token["end"] = tokens_with_timestamps[i + 1]["end"] - token["whitespace"] = tokens_with_timestamps[i + 1]["whitespace"] - i += 1 - - processed_tokens.append(token) - i += 1 + + processed_tokens = tokens_with_timestamps # Use tokens directly # Use processed_tokens instead of tokens_with_timestamps for the rest of the method if self.subtitle_mode == "Sentence + Highlighting": diff --git a/abogen/queue_manager_gui.py b/abogen/queue_manager_gui.py index d8514b2..ee7684e 100644 --- a/abogen/queue_manager_gui.py +++ b/abogen/queue_manager_gui.py @@ -140,7 +140,7 @@ class QueueManager(QDialog): instructions = QLabel( "

How Queue Works?

" "You can add text files (.txt) directly using the 'Add files' button below. " - "To add PDF or EPUB files, use the input box in the main window and click the 'Add to Queue' button. " + "To add PDF, EPUB or markdown files, use the input box in the main window and click the 'Add to Queue' button. " "Each file in the queue keeps the configuration settings active when it was added. " "Changing the main window configuration afterward does not affect files already in the queue. " "You can view each file's configuration by hovering over them."