Completely strip CRLF characters from expression result (and don't just replace with newline)
@see https://www.filebot.net/forums/viewtopic.php?f=10&t=5390
This commit is contained in:
parent
c1f1cfd4f1
commit
dedc1d73b3
|
@ -2,6 +2,7 @@ package net.filebot.format;
|
|||
|
||||
import static net.filebot.similarity.Normalization.*;
|
||||
import static net.filebot.util.FileUtilities.*;
|
||||
import static net.filebot.util.RegularExpressions.*;
|
||||
|
||||
import javax.script.Bindings;
|
||||
import javax.script.ScriptException;
|
||||
|
@ -36,7 +37,11 @@ public class ExpressionFileFormat extends ExpressionFormat {
|
|||
@Override
|
||||
protected String normalizeResult(CharSequence value) {
|
||||
// normalize unicode space characters and remove newline characters
|
||||
return normalizePathSeparators(replaceSpace(value, " ").trim());
|
||||
return normalizePathSeparators(replaceSpace(stripCRLF(value), " ").trim());
|
||||
}
|
||||
|
||||
protected String stripCRLF(CharSequence value) {
|
||||
return NEWLINE.matcher(value).replaceAll("");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue