mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-23 00:06:17 -04:00
Add unicode tests
This commit is contained in:
parent
13a54ec318
commit
3ab95384df
5 changed files with 87 additions and 27 deletions
|
@ -19,7 +19,7 @@ class RemoveDiacritics extends Operation {
|
|||
|
||||
this.name = "Remove Diacritics";
|
||||
this.module = "Default";
|
||||
this.description = "Replaces accented characters with their latin character equivalent.";
|
||||
this.description = "Replaces accented characters with their latin character equivalent. Accented characters are made up of Unicode combining characters, so unicode text formatting such as strikethroughs and underlines will also be removed.";
|
||||
this.infoURL = "https://wikipedia.org/wiki/Diacritic";
|
||||
this.inputType = "string";
|
||||
this.outputType = "string";
|
||||
|
|
|
@ -46,7 +46,6 @@ class UnicodeTextFormat extends Operation {
|
|||
run(input, args) {
|
||||
const [underline, strikethrough] = args;
|
||||
let output = input.map(char => [char]);
|
||||
console.dir(output);
|
||||
if (strikethrough) {
|
||||
output = output.map(charFormat => {
|
||||
charFormat.push(...Utils.strToUtf8ByteArray("\u0336"));
|
||||
|
@ -59,8 +58,8 @@ class UnicodeTextFormat extends Operation {
|
|||
return charFormat;
|
||||
});
|
||||
}
|
||||
console.dir(output);
|
||||
return output.flat();
|
||||
// return output.flat(); - Not supported in Node 10, polyfilled
|
||||
return [].concat(...output);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue