* Fixed multiline replace
This commit is contained in:
parent
330ed1ee2e
commit
2d2c326805
1 changed files with 6 additions and 6 deletions
|
|
@ -173,18 +173,18 @@ Search.SELECTION = 2;
|
|||
*
|
||||
**/
|
||||
this.replace = function(input, replacement) {
|
||||
if (!this.$options.regExp)
|
||||
return input == this.$options.needle ? replacement : null;
|
||||
|
||||
var re = this.$assembleRegExp();
|
||||
if (!re)
|
||||
return;
|
||||
|
||||
var match = re.exec(input);
|
||||
if (match && match[0].length == input.length) {
|
||||
if (this.$options.regExp) {
|
||||
return input.replace(re, replacement);
|
||||
} else {
|
||||
return replacement;
|
||||
}
|
||||
} else {
|
||||
return input.replace(re, replacement);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue