Fix error when decoding a text with 2+ whitespaces in AMNZ mode
This commit is contained in:
parent
d36cede0c7
commit
282f02f4d5
@ -77,10 +77,14 @@ class BaconCipherDecode extends Operation {
|
||||
}
|
||||
});
|
||||
} else if (translation === BACON_TRANSLATION_AMNZ) {
|
||||
const words = input.split(" ");
|
||||
const words = input.split(/\s+/);
|
||||
const letters = words.map(function (e) {
|
||||
if (e) {
|
||||
const code = e[0].toUpperCase().charCodeAt(0);
|
||||
return code >= "N".charCodeAt(0) ? "1" : "0";
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
});
|
||||
input = letters.join("");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user