mirror of https://github.com/Textualize/rich.git
fix invalid escapes
This commit is contained in:
parent
5d3f600f43
commit
90a7224ee6
|
@ -4,7 +4,7 @@ import re
|
||||||
from rich.console import Console, RenderableType
|
from rich.console import Console, RenderableType
|
||||||
|
|
||||||
|
|
||||||
re_link_ids = re.compile(r"id=[\d\.\-]*?;.*?\x1b")
|
re_link_ids = re.compile(r"id=[\d.\-]*?;.*?\x1b")
|
||||||
|
|
||||||
|
|
||||||
def replace_link_ids(render: str) -> str:
|
def replace_link_ids(render: str) -> str:
|
||||||
|
|
|
@ -144,7 +144,7 @@ def test_markup_error():
|
||||||
|
|
||||||
|
|
||||||
def test_markup_escape():
|
def test_markup_escape():
|
||||||
result = str(render("[dim white]\[url=[/]"))
|
result = str(render("[dim white][url=[/]"))
|
||||||
assert result == "[url="
|
assert result == "[url="
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ def test_handler():
|
||||||
"│" + (" " * 98) + "│",
|
"│" + (" " * 98) + "│",
|
||||||
)
|
)
|
||||||
for frame_start in re.finditer(
|
for frame_start in re.finditer(
|
||||||
"^│ .+rich/tests/test_traceback\.py:",
|
"^│ .+rich/tests/test_traceback.py:",
|
||||||
rendered_exception,
|
rendered_exception,
|
||||||
flags=re.MULTILINE,
|
flags=re.MULTILINE,
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in New Issue