-
Notifications
You must be signed in to change notification settings - Fork 165
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 new process to replace the matches #299
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very useful. I proposed 2 changes.
css/redirector.css
Outdated
@@ -479,7 +479,7 @@ a.disabled:hover, button[disabled]:hover { | |||
} | |||
|
|||
.hidden { | |||
display:none; | |||
display:none !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this CSS ruleset really need !important
added? Is there a way to avoid adding !important
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.form-grid > div
selector has a higher specificity and cause an issue so I thought as a utility class it's ok to add !important
but It can be avoided by adding the same declaration with .replace-process-input.hidden
selector.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I'm good either way. I think adding the .replace-process-input.hidden
selector to the .hidden
ruleset is a slightly better option. It's a bit cleaner and will prevent any problems in the future if someone removes !important
from .hidden
because it's not documented why it's present.
js/redirect.js
Outdated
|
||
if (incPattern) { | ||
this._rxInclude = new RegExp(incPattern, 'gi'); | ||
} | ||
if (excPattern) { | ||
this._rxExclude = new RegExp(excPattern, 'gi'); | ||
} | ||
if (replPattern) { | ||
const falgs = this.replaceAll ? 'gi' : 'i'; | ||
this._rxReplace = new RegExp(replPattern, falgs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
falgs
needs to be replaced with flags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you! I think this is a significant improvement. Well done.
I needed a simple way to clean matches or replace some characters.
Example:
From:
http://example.com/some-word-that-matches-wildcard
To:
http://google.com/some+word+that+matches+wildcard
Include pattern:
http://example.com/*
Redirect to:
http://google.com/$1
Find:
-
Replace with:
+
replace All:
true
This will process all the matches ($1, $2, ...) with the same thing and NEED a way to separate them