added new process to replace the matches#299
added new process to replace the matches#299asedii wants to merge 4 commits intoeinaregilsson:masterfrom
Conversation
Gitoffthelawn
left a comment
There was a problem hiding this comment.
Looks very useful. I proposed 2 changes.
css/redirector.css
Outdated
|
|
||
| .hidden { | ||
| display:none; | ||
| display:none !important; |
There was a problem hiding this comment.
Does this CSS ruleset really need !important added? Is there a way to avoid adding !important?
There was a problem hiding this comment.
.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.
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 (replPattern) { | ||
| const falgs = this.replaceAll ? 'gi' : 'i'; | ||
| this._rxReplace = new RegExp(replPattern, falgs); |
There was a problem hiding this comment.
falgs needs to be replaced with flags
Gitoffthelawn
left a comment
There was a problem hiding this comment.
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-wildcardTo:
http://google.com/some+word+that+matches+wildcardInclude pattern:
http://example.com/*Redirect to:
http://google.com/$1Find:
-Replace with:
+replace All:
trueThis will process all the matches ($1, $2, ...) with the same thing and NEED a way to separate them