jerboa icon indicating copy to clipboard operation
jerboa copied to clipboard

Handle /c/community@host URLs

Open beatgammit opened this issue 1 year ago • 4 comments

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.

beatgammit avatar Jun 13 '23 07:06 beatgammit

Also partial fix for #454

beatgammit avatar Jun 13 '23 07:06 beatgammit

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.

beatgammit avatar Jun 14 '23 04:06 beatgammit

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)

helpimnotdrowning avatar Jun 14 '23 14:06 helpimnotdrowning

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.

beatgammit avatar Jun 14 '23 14:06 beatgammit