Skip to content
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

[REQUEST] Account for file:// URLs in the default highlighter's regexes #1681

Closed
pradyunsg opened this issue Nov 12, 2021 · 4 comments
Closed
Labels
accepted Task was accepted task

Comments

@pradyunsg
Copy link

Have you checked the issues for a similar suggestions? Yup. :)

How would you improve Rich?

https://github.com/willmcgugan/rich/blob/1b12bb68f9a0376f3da69e372058f7af56600eed/rich/highlighter.py#L99

Include file scheme on this line.

What problem does it solve for you?

It'd make the file:// URLs printed out by pip look better.

Screenshot 2021-11-12 at 12 41 14

Did I help

If I was able to resolve your problem, consider sponsoring my work on Rich, or buy me a coffee to say thanks.

@willmcgugan willmcgugan added accepted Task was accepted task and removed Needs triage labels Nov 12, 2021
@willmcgugan
Copy link
Collaborator

I'll add that to the next update.

If you need it in a hurry, you could create a custom Highlighter class (based on ReprHighlighter) and pass that in to your Console instance.

@pradyunsg
Copy link
Author

Neato! Thanks! ^>^

@willmcgugan
Copy link
Collaborator

That's in 10.14.0

@github-actions
Copy link

Did I solve your problem?

Consider sponsoring the ongoing work on Rich and Textual.

Or buy me a coffee to say thanks.

Will McGugan

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Nov 23, 2021
10.14.0

Fixed

Fixed progress speed not updating when total doesn't change
Fixed superfluous new line in Status Textualize/rich#1662
Fixed Windows legacy width again
Fixed infinite loop in set_cell_size Textualize/rich#1682

Added

Added file protocol to URL highlighter Textualize/rich#1681
Added rich.protocol.rich_cast

Changed

Allowed __rich__ to work recursively
Allowed Text classes to work with sep in print Textualize/rich#1689
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Task was accepted task
Projects
None yet
Development

No branches or pull requests

2 participants