libreddit icon indicating copy to clipboard operation
libreddit copied to clipboard

Make rewrite_urls more precise with regard to backslash removal and support "new" subdomain.

Open mikupls opened this issue 3 years ago • 4 comments

Adjust function description and add another test-case.


Addresses #475 and relates to #281.

So we have tests for both observed breakages now. However, now that I understand a bit more what is going on here, this solution is also far from perfect. It will start breaking again once someone intentionally puts \_ into a comment AFAICT.

The intention of the function is probably to limit the scope of the regex replacement to <a></a> elements. However operating with regexes on HTML is known to be tricky (or "impossible"). I propose we live with this intermediary solution until someone finds another relevant breakage.

mikupls avatar Apr 16 '22 10:04 mikupls

Added another commit to support "new.reddit.com"; discovered on r/japan/comments/skbmu8/the_rjapan_basic_questions_thread_february_2022/.

mikupls avatar Apr 17 '22 09:04 mikupls

Anything else that is needed here?

mikupls avatar May 24 '22 20:05 mikupls

Sorry this has been on the backburner. I'm going through outstanding issues and PRs and intend to get to this one soon. Bleiben Sie dran.

Daniel-Valentine avatar Feb 26 '23 09:02 Daniel-Valentine

Thanks. Looks like this patch still applies cleanly. Don't expect me to be able to explain the regexes after a year though :)

mikupls avatar Mar 02 '23 11:03 mikupls