This change extracts HTML diff generation into its own class, HtmlDiffGenerator, from FixCommonErrors form. The main reason for this is to improve code modularity and maintainability. Additionally, it helps to maintain the single responsibility principle by separating the error fixing and HTML diff generation concerns. Now, HTML diff generation is more reusable and testable on its own.
An error was noticed in the language check within AdvancedTextBox.cs where it was checking for "en " (with an extra whitespace) which always returned false and thus the condition inside never executed. This commit removes the unwanted whitespace to fix the condition check for English language ("en").
Modified the LoadDictionariesAsync method to directly return a new Task. This eliminates the need for async/await and simplifies code while maintaining functionality.
Extracted the logic checking dictionary availability into a separate method "IsDictionaryAvailable". This aims to improve code readability and modularity, thereby promoting better maintainability. Instead of having the logic embedded in the InitializeLiveSpellCheck method, it's now in its own method that can be used elsewhere if needed.
This commit streamlines the treatment of extra spaces and number identification within the WebVTT subtitle format handling implementation. The function `RemoveWeirdRepeatingHeader` now utilizes the more efficient `FixExtraSpaces` method. The number identification in the loop has been modified to use `IsDigit` from the `CharUtils` class for better readability and consistency across the code base."
Removed a loop that repeatedly checked for and removed consecutive line breaks from a text string in the WebVTT subtitle format implementation. This was replaced with a single function call to `RemoveRecursiveLineBreaks()`, which improves code readability and computational efficiency.
The change ensures that the "WEBVTT" title line is always followed by a newline, regardless of whether the subtitle header is present or not. This guarantees correct formatting adhering to WebVTT subtitle spec rules.