* Fixed multiline replace

This commit is contained in:
Ruben Daniels 2012-05-08 21:08:59 -07:00
commit 2d2c326805

View file

@ -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;
}
};