Skip to content

Commit

Permalink
replace tspans with text
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed May 17, 2022
1 parent 1772458 commit fc5a1ad
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions rich/_export_format.py
Expand Up @@ -50,7 +50,6 @@
.{unique_id}-title {{
font-size: 18px;
font-weight: bold;
font-family: arial;
}}
Expand All @@ -60,7 +59,9 @@
{chrome}
<g transform="translate({terminal_x}, {terminal_y})">
{backgrounds}
<text alignment-baseline="baseline" class="{unique_id}-matrix" font-variant="east-asian-width-values">{matrix}</text>
<g class="{unique_id}-matrix">
{matrix}
</g>
</g>
</svg>
"""
Expand Down
20 changes: 11 additions & 9 deletions rich/console.py
Expand Up @@ -2385,16 +2385,18 @@ def stringify(value: object) -> str:
height=line_height + 1,
)
)
text_group.append(
make_tag(
"tspan",
escape_text(text),
_class=f"{unique_id}-{class_name}",
x=x * char_width,
y=y * line_height + char_height,
textLength=char_width * len(text),

if text != " " * len(text):
text_group.append(
make_tag(
"text",
escape_text(text),
_class=f"{unique_id}-{class_name}",
x=x * char_width,
y=y * line_height + char_height,
textLength=char_width * len(text),
)
)
)
x += cell_len(text)

styles = "\n".join(
Expand Down

0 comments on commit fc5a1ad

Please sign in to comment.