code cleaning

This commit is contained in:
Kutaz 2023-01-10 11:20:03 -05:00
parent 51b6f915ff
commit 4c37c57ed5
2 changed files with 11 additions and 11 deletions

View file

@ -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 (__) {}
} }

View file

@ -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);
} }
}); });
} }