-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Link to local files with spaces in their path don't render in Console #3138
Labels
Comments
I think it is Windows rather than Rich doing this extra encoding, for what it's worth. from rich.console import Console
from rich.text import Text
text_with_encoding = r"foo%20bar%20baz"
rich_text = Text.from_markup(f"[link={text_with_encoding}]Text with encoding[/link]")
path_with_encoding = r"C:\Users\Tom\Documents\New%20Text%20Document.txt"
rich_path = Text.from_markup(f"[link={path_with_encoding}]Path with encoding[/link]")
console = Console()
console.print(rich_text)
console.print(rich_text.get_style_at_offset(console, 0))
console.print(rich_path)
console.print(rich_path.get_style_at_offset(console, 0)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using
[link=<link>]<text>[/link]
to display a link in the console, it works well with local files except when these files have a space in it.link
Style (the code does not enter inStyle.parse
for this)file://my%20F/my%20Ffile.txt
), then rich replace%20F
by%25F20F
making the link unusablePlatform
The text was updated successfully, but these errors were encountered: