Fix SVG color handling and alignment issues

- Fix hex color conversion for pyte's 256-color/truecolor format (no # prefix)
- Track column count separately from text length for proper wide char alignment
- Add tests for rgb() color format, empty rows, unicode slugify
- Improve test coverage to 80%

Bump version to 0.3.1
This commit is contained in:
GitHub Copilot
2026-01-24 18:39:25 +00:00
parent 4f4b811967
commit 631ab33b4d
3 changed files with 55 additions and 1 deletions
+9
View File
@@ -38,3 +38,12 @@ class TestSlugify:
"""Test that leading/trailing spaces are handled."""
result = slugify(" hello ")
assert "hello" in result
def test_allow_unicode_preserves_unicode(self):
"""Test that allow_unicode=True preserves unicode characters."""
# With allow_unicode=True, unicode chars are normalized but preserved
result = slugify("héllo wörld", allow_unicode=True)
assert result == "héllo-wörld"
# Without allow_unicode (default), non-ASCII is transliterated
result_ascii = slugify("héllo wörld", allow_unicode=False)
assert result_ascii == "hello-world"