Skip to content

Expand CSS shorthand hex colors before ANSI conversion - #92

Open
ShahadatTest wants to merge 1 commit into
xolox:masterfrom
ShahadatTest:fix/css-shorthand-colors
Open

ShahadatTest wants to merge 1 commit into
xolox:masterfrom
ShahadatTest:fix/css-shorthand-colors

Conversation

@ShahadatTest

Copy link
Copy Markdown

Three-digit CSS hex colors duplicate each digit: #fff is #ffffff. HTMLConverter currently parses each digit directly, giving (15, 15, 15) instead of (255, 255, 255), so shorthand and full notation render different colors. Expand each component before converting it.

The new regression fails before the change. It checks white, mixed-case and numeric colors, and compares foreground/background ANSI output with the equivalent six-digit notation. Python 3.12: both the new test and existing HTML conversion test pass. The same 3 parser checks and 6 foreground/background comparisons pass on Python 3.10. Flake8 and diff checks pass.

Full Python 3.12 unittest run: 70 tests, with the same 1 failure and 5 errors as pristine master (69 tests). These affect the existing HOME-dependent path checks, terminal/CLI capture and MockedProgram tests on this Windows environment. The affected HTML tests pass; a clean full suite or historical Python 2.7-3.9 matrix is not claimed.

Prepared with OpenAI Codex (GPT-6) assistance for new 10ta koro (make 10 new contributions). No human code review or personal production usage is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant