Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added features to ignore and replace urls #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Bergiu
Copy link

@Bergiu Bergiu commented Aug 17, 2023

This merge requests adds the two features I've requested in #15.

Two major changes:

  • Added features: ignore list, replacement patterns.
  • Changed behavior for checking if a link is archived.

Settings menu

It adds two new sections to the settings page.
The first one is used to add links to the ignore list. It's using regex to describe a url tho you need to escape dots in the urls. For example if you want to add youtube to the ignore list you can add www\.youtube\.com. This matches all links containing the string because no $ or ^ is used.

The second one is used to create replacements. There is one box where you can add the pattern for the original pattern and one for the replacement. Within the original pattern you need to escape dots and in the replacement pattern you don't. You can use groups like this: original is http:\/\/(.+) and replacement https://$1.

image

Changed behavior for checking if a link is archived

I've added three rules for checking if a link is already archived to the filter.

Two of them are the trivial ones: all links in the ignore list are filtered and all links where a replaced link is in the list is ignored.

The third one is not really related to the issue, but I thought it would be nice to have. If you don't like it i would remove it or add an option in the settings menu for it.

The third one checks if the link is followed by [Archived] (the same format as the plugin adds it to the note). This is useful to add a custom archived link.

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.

1 participant