mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 14:11:02 +01:00
Fixed 'To Hex' highlighting
This commit is contained in:
parent
ec577fc075
commit
ff99436ce6
@ -67,7 +67,7 @@ class ToHex extends Operation {
|
|||||||
* @returns {Object[]} pos
|
* @returns {Object[]} pos
|
||||||
*/
|
*/
|
||||||
highlight(pos, args) {
|
highlight(pos, args) {
|
||||||
let delim, commaLen;
|
let delim, commaLen = 0;
|
||||||
if (args[0] === "0x with comma") {
|
if (args[0] === "0x with comma") {
|
||||||
delim = "0x";
|
delim = "0x";
|
||||||
commaLen = 1;
|
commaLen = 1;
|
||||||
@ -86,7 +86,7 @@ class ToHex extends Operation {
|
|||||||
pos[0].start = pos[0].start * (2 + len) + countLF(pos[0].start);
|
pos[0].start = pos[0].start * (2 + len) + countLF(pos[0].start);
|
||||||
pos[0].end = pos[0].end * (2 + len) + countLF(pos[0].end);
|
pos[0].end = pos[0].end * (2 + len) + countLF(pos[0].end);
|
||||||
|
|
||||||
// if the deliminators are not prepended, trim the trailing deliminator
|
// if the delimiters are not prepended, trim the trailing delimiter
|
||||||
if (!(delim === "0x" || delim === "\\x")) {
|
if (!(delim === "0x" || delim === "\\x")) {
|
||||||
pos[0].end -= delim.length;
|
pos[0].end -= delim.length;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user