added features to ignore and replace urls #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This merge requests adds the two features I've requested in #15.
Two major changes:
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 replacementhttps://$1
.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.