Don't merge box-drawing characters for precise positioning

Box-drawing and block element characters (U+2500-U+259F, U+25A0-U+25FF)
are now rendered as individual tspans with their own x positions to
prevent visual misalignment caused by font rendering variations.
This commit is contained in:
GitHub Copilot
2026-01-24 18:58:19 +00:00
parent 259f88917c
commit ba1f89af54
2 changed files with 22 additions and 2 deletions
+5 -2
View File
@@ -716,14 +716,17 @@ class TestEdgeCases:
assert "A中B🎉C" in svg
def test_special_unicode_blocks(self) -> None:
"""Unicode box drawing characters render."""
"""Unicode box drawing characters render (separately for precise positioning)."""
buffer = [[
self._char(""),
self._char(""),
self._char(""),
]]
svg = render_terminal_svg(buffer, width=3, height=1)
assert "┌─┐" in svg
# Box drawing chars are rendered separately for precise x positioning
assert "" in svg
assert "" in svg
assert "" in svg
def test_ansi_bright_colors(self) -> None:
"""All bright ANSI colors render."""