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

Running Textual tests opens links in my web browser? #5169

Closed
TomJGooding opened this issue Oct 24, 2024 · 8 comments · Fixed by #5170
Closed

Running Textual tests opens links in my web browser? #5169

TomJGooding opened this issue Oct 24, 2024 · 8 comments · Fixed by #5170

Comments

@TomJGooding
Copy link
Contributor

TomJGooding commented Oct 24, 2024

This is a bit of a weird one and might just be some issue in my setup! After pulling the latest changes, I was a bit concerned when links started opening in my web browser! This includes http://tété/, https://test.md/#first and filepaths like /textual/#second

Anyone else experiencing this or have any idea what the issue might be?!

Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@willmcgugan
Copy link
Collaborator

I suspect that is because I changed the Markdown widgets to open urls by default. We probably need to set open_links = False on the Markdown tests.

@TomJGooding
Copy link
Contributor Author

Oof, thanks Will that explains it! Fix incoming...!

@TomJGooding
Copy link
Contributor Author

TomJGooding commented Oct 24, 2024

Perhaps I should raise a separate issue for this, but I'm wondering if opening links by default is actually a good idea?

Markdown links might not be websites but actually a heading or other documents on the disk. For example, now running examples/markdown.py and clicking the example.md link will try to open this in the browser.

@willmcgugan
Copy link
Collaborator

It was added recently, because too many users expected it and were opening issues.

The problem is that it is ambigious. is markdown.md a file or https://markdown.md ?

I'm not disagreeing though. The default behavior should be the least astonishing -- whatever that may be. Anything else, the dev can handling the appropriate event.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

@TomJGooding
Copy link
Contributor Author

TomJGooding commented Oct 24, 2024

Damned if you do and damned if you don't!

My concern is that internal links are probably more common than external links (e.g. table of contents), so this will just open new issues.

Perhaps there's some compromise, or the documentation can be improved on handling markdown links.

(I'm guessing these are issues raised in the Discord, as I don't recall seeing any issues/discussions in this repo?)

@TomJGooding
Copy link
Contributor Author

Thankfully test.md wasn't malicious, but perhaps also worth considering whether potentially opening all .md domains by default is a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants