mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 00:05:11 -04:00
Fixed the bug where the comments were preventing the rendering of the HTML
This commit is contained in:
parent
c9d9730726
commit
a357d2a1be
1 changed files with 15 additions and 2 deletions
|
@ -190,6 +190,7 @@ class Recipe {
|
||||||
for (let i = startFrom; i < this.opList.length; i++) {
|
for (let i = startFrom; i < this.opList.length; i++) {
|
||||||
op = this.opList[i];
|
op = this.opList[i];
|
||||||
log.debug(`[${i}] ${op.name} ${JSON.stringify(op.ingValues)}`);
|
log.debug(`[${i}] ${op.name} ${JSON.stringify(op.ingValues)}`);
|
||||||
|
|
||||||
if (op.disabled) {
|
if (op.disabled) {
|
||||||
log.debug("Operation is disabled, skipping");
|
log.debug("Operation is disabled, skipping");
|
||||||
continue;
|
continue;
|
||||||
|
@ -200,7 +201,13 @@ class Recipe {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
if (op.name != "Comment") {
|
||||||
input = await dish.get(op.inputType);
|
input = await dish.get(op.inputType);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
input = dish.value ;
|
||||||
|
}
|
||||||
log.debug(`Executing operation '${op.name}'`);
|
log.debug(`Executing operation '${op.name}'`);
|
||||||
|
|
||||||
if (isWorkerEnvironment()) {
|
if (isWorkerEnvironment()) {
|
||||||
|
@ -227,7 +234,12 @@ class Recipe {
|
||||||
output = await op.run(input, op.ingValues);
|
output = await op.run(input, op.ingValues);
|
||||||
dish.set(output, op.outputType);
|
dish.set(output, op.outputType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if comment is the lastRunOp, the output we want is the previous command, not necessarily a String
|
||||||
|
if (op.name != "Comment"){
|
||||||
this.lastRunOp = op;
|
this.lastRunOp = op;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Return expected errors as output
|
// Return expected errors as output
|
||||||
if (err instanceof OperationError ||
|
if (err instanceof OperationError ||
|
||||||
|
@ -273,6 +285,7 @@ class Recipe {
|
||||||
await dish.get(this.lastRunOp.outputType),
|
await dish.get(this.lastRunOp.outputType),
|
||||||
this.lastRunOp.ingValues
|
this.lastRunOp.ingValues
|
||||||
);
|
);
|
||||||
|
|
||||||
dish.set(output, this.lastRunOp.presentType);
|
dish.set(output, this.lastRunOp.presentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue