Skip to content

Handler for lemmyverse.link shared links.#2117

Open
RandomDennisLee wants to merge 1 commit into
thunder-app:developfrom
RandomDennisLee:lemmyverse_parser
Open

Handler for lemmyverse.link shared links.#2117
RandomDennisLee wants to merge 1 commit into
thunder-app:developfrom
RandomDennisLee:lemmyverse_parser

Conversation

@RandomDennisLee

Copy link
Copy Markdown

Pull Request Description

Added check for links in the format of "lemmyverse.link/known_instance/post/1234". Compared against known_instance.dart to look for lemmy / piefed shared links. Domain is generic, will match any domain.

On match, will rewrite the link from "lemmyverse.link/known_instance/post/1234" to "known_instance/post/1234" and pass it on to the existing link parsers.

Issue Being Fixed

Issue Number: Add support for lemmyverse links

Screenshots / Recordings

Checklist

  • [N/A] If a new package was added, did you ensure it uses an appropriate license and is actively maintained?
  • [N/A] Did you use localized strings (and added appropriate descriptions) where applicable?
  • [N/A] Did you add semanticLabels where applicable for accessibility?

@hjiangsu hjiangsu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - just one small change!

/// Matches instance.tld/post/123
/// Groups: 2=instance, 3=postId
final RegExp _lemmyPostUrl = RegExp(r'^(https?:\/\/)(.*)/post/([0-9]+)$');
// final RegExp _lemmyPostUrl = RegExp(r'^(https?:\/\/)(.*)/post/([0-9]+)$');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to keep this, we can just remove it if we're replacing the regex!

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 this pull request may close these issues.

2 participants