michael-lazar / rtv

Browse Reddit from your terminal
MIT License
4.64k stars 274 forks source link

Issue #593: Allow opening links #594

Closed codesoap closed 5 years ago

codesoap commented 6 years ago

Give the user the ability to open links, that are mentioned in comments and submissions.

If there are links mentioned in a comment or submission's text the user will be prompted to select the link he/she wants to open, when pressing ENTER (default key bindings).

Links to a page within reddit are currently not opened within rtv. I think it's debatable whether that's the expected behavior or not.

I will appreciate any feedback :-)

@QA: Here are some links for testing different behaviors: "Link only submissions" still open the link: https://www.reddit.com/r/unixporn/comments/8uq1ti/bspwm_daft_punk/ Submissions with text still open the permalink: https://www.reddit.com/r/AMA/comments/8e19nw/i_am_the_voice_of_boo_from_monsters_inc_ama/ Submissions with text, that mentions links open prompt: https://www.reddit.com/r/AMA/comments/8pc8mf/im_nat_friedman_future_ceo_of_github_ama/ Comments without links still open the permalink: https://www.reddit.com/r/gifs/comments/96wwj3/best_kiki_challenge_p/e43sdso/ Comments with links open prompt: https://www.reddit.com/r/gifs/comments/96wwj3/best_kiki_challenge_p/e43xz7m/

codesoap commented 6 years ago

Thank you very much for the thorough code review and feedback! I will try to solve the issues you found and add the solutions to this PR.

codesoap commented 6 years ago

Alright, I worked on the points you mentioned and added the changes to this PR.

michael-lazar commented 5 years ago

@codesoap sorry for being slow on the code reviews, I will try to get to this soon

codesoap commented 5 years ago

No worries, @michael-lazar and thanks for the info!

michael-lazar commented 5 years ago

I added some tests. moved a couple of methods around, and fixed the issue that I found with url_full. Overall the PR looked great, thank you for incorporating all of my feedback!