Repository navigation
Flush pending HTML text before resetting terminal styles - #95
Open
ShahadatTest wants to merge 1 commit into
Open
ShahadatTest wants to merge 1 commit into
ShahadatTest wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTMLParser buffers incomplete character references until close(). HTMLConverter currently resets terminal styles before that final flush. For example, tail & emits its text after the bold style has already ended. Flush the parser first, then reset remaining styles in a finally block so a callback exception still closes the terminal style.
Both new buffered-tail and streaming-close regressions fail against original master. After the fix, those two tests, a callback-error cleanup control and the existing HTML test all pass. Coverage includes eight bold/italic/code/color buffered tails, streaming input, repeated close and unstyled text. The same behavior checks pass independently on Python 3.10. Flake8 and diff checks pass.
Full Python 3.12 unittest run: 72 tests, with the same 1 failure and 5 errors as pristine master's 69-test run on this Windows host (HOME/path checks, terminal/CLI capture and MockedProgram). No clean full suite or historical Python 2.7-3.9 matrix is claimed. This fixes parser finalization, independently of pending #92's color parsing and #93's anchor capture.
Found through source inspection and local reproduction for
Aro 2ta koro(make two more contributions). Prepared with OpenAI Codex (GPT-6) assistance, including investigation, implementation, testing and PR preparation. No personal production usage or human code review is claimed.