jerboa
jerboa copied to clipboard
Handle /c/community@host URLs
This is a partial fix to #556, but it at least prevents crashing when an unknown URL type is encountered. There is still some work to do, since the markdown plugin interprets the following as mailto: urls:
- @user@instance
- !community@instance
I'm not sure what the supported URL types are intended to be, so I didn't bother implementing a plugin.
Also partial fix for #454
I redid the PR and added some tests. The code is kind of repetitive, but hopefully easy to follow.
I'm interested in adding a bunch of tests, so let me know if there's a good reason not to upgrade to JUnit 5, since I may want to do that to get parameterized tests working properly.
this doesn't seem to cover reddit-style* links like c/[email protected] or u/[email protected] (missing 1st slash), is this intentional?
(ok I guess these are all technically "reddit-style" but i think my point gets across)
Links without the leading / are incorrect on Reddit IIRC (at least on old Reddit), and I personally think they're bad style, so I tried to keep this PR uncontroversial. Also, Jerboa doesn't handle user links anyway, so I figured I'd revisit once it does.
It intend to figure out how to do a plugin for the markdown library to get it to process links, and I suppose I can look into that when I do.