mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-08 15:25:01 -04:00
code cleaning
This commit is contained in:
parent
51b6f915ff
commit
4c37c57ed5
2 changed files with 11 additions and 11 deletions
|
@ -52,7 +52,7 @@ class RenderMarkdown extends Operation {
|
||||||
highlight: function(str, lang) {
|
highlight: function(str, lang) {
|
||||||
if (lang && hljs.getLanguage(lang) && enableHighlighting) {
|
if (lang && hljs.getLanguage(lang) && enableHighlighting) {
|
||||||
try {
|
try {
|
||||||
return hljs.highlight(lang, str).value;
|
return hljs.highlight(lang, str).value;
|
||||||
} catch (__) {}
|
} catch (__) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -535,8 +535,8 @@ class OutputWaiter {
|
||||||
file = new File([data], fileName);
|
file = new File([data], fileName);
|
||||||
FileSaver.saveAs(file, fileName, false);
|
FileSaver.saveAs(file, fileName, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handler for file download as pdf events.
|
* Handler for file download as pdf events.
|
||||||
*/
|
*/
|
||||||
async downloadPdf() {
|
async downloadPdf() {
|
||||||
|
@ -553,15 +553,15 @@ class OutputWaiter {
|
||||||
const data = await dish.get(Dish.HTML);
|
const data = await dish.get(Dish.HTML);
|
||||||
// console.log(data, "this is our html")
|
// console.log(data, "this is our html")
|
||||||
const doc = new jsPDF("p", "px", "a4");
|
const doc = new jsPDF("p", "px", "a4");
|
||||||
|
|
||||||
const width = doc.internal.pageSize.getWidth();
|
const width = doc.internal.pageSize.getWidth();
|
||||||
doc.html(data, {
|
doc.html(data, {
|
||||||
autoPaging: "text",
|
autoPaging: "text",
|
||||||
width: width,
|
width: width,
|
||||||
windowWidth: width,
|
windowWidth: width,
|
||||||
callback: function (doc) {
|
callback: function (doc) {
|
||||||
doc.save(fileName);
|
doc.save(fileName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue