mirror of
https://github.com/gchq/CyberChef
synced 2026-01-05 01:53:36 +00:00
Changed 'Remove Letter Accents' to 'Remove Diacritics'
This commit is contained in:
@@ -168,7 +168,7 @@
|
||||
"ops": [
|
||||
"Encode text",
|
||||
"Decode text",
|
||||
"Remove Letter Accents",
|
||||
"Remove Diacritics",
|
||||
"Unescape Unicode Characters"
|
||||
]
|
||||
},
|
||||
|
||||
@@ -7,24 +7,23 @@
|
||||
import Operation from "../Operation";
|
||||
|
||||
/**
|
||||
* Remove Letter Accents operation
|
||||
* Remove Diacritics operation
|
||||
*/
|
||||
class RemoveLetterAccents extends Operation {
|
||||
class RemoveDiacritics extends Operation {
|
||||
|
||||
/**
|
||||
* RemoveLetterAccents constructor
|
||||
* RemoveDiacritics constructor
|
||||
*/
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.name = "Remove Letter Accents";
|
||||
this.name = "Remove Diacritics";
|
||||
this.module = "Default";
|
||||
this.description = "Replaces accented characters with their latin character equivalent.";
|
||||
this.infoURL = "";
|
||||
this.infoURL = "https://wikipedia.org/wiki/Diacritic";
|
||||
this.inputType = "string";
|
||||
this.outputType = "string";
|
||||
this.args = [
|
||||
];
|
||||
this.args = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,10 +32,10 @@ class RemoveLetterAccents extends Operation {
|
||||
* @returns {string}
|
||||
*/
|
||||
run(input, args) {
|
||||
//reference: https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463
|
||||
// reference: https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463
|
||||
return input.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RemoveLetterAccents;
|
||||
export default RemoveDiacritics;
|
||||
Reference in New Issue
Block a user