From c26e3ab3f60805758f23ef3bbd9f47abb19a21dd Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Wed, 17 Aug 2022 21:15:50 -0700 Subject: [PATCH] More trypandoc refinements. --- trypandoc/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trypandoc/index.html b/trypandoc/index.html index e5247d758..effee3802 100644 --- a/trypandoc/index.html +++ b/trypandoc/index.html @@ -156,7 +156,7 @@ function newpage() { (function() { const params = new URLSearchParams(window.location.search); - let text = params.get("text"); + let text = params.get("text") || '"hello *world*"'; document.getElementById("text").value = text; let from = params.get("from") || "markdown"; document.getElementById("from").value = from; @@ -173,6 +173,10 @@ function newpage() { let params = { from: from, to: to, text: text, standalone: standalone }; // console.log(JSON.stringify(params)); + let commandString = "pandoc" + + " --from " + from + " --to " + to + + (standalone ? " --standalone" : ""); + document.getElementById("command").textContent = commandString; fetch("/cgi-bin/pandoc-server.cgi", { method: "POST", headers: {"Content-Type": "application/json"}, @@ -181,10 +185,6 @@ function newpage() { .then(response => response.text()) .then(restext => { document.getElementById("results").textContent = restext; - let commandString = "pandoc" - + (standalone ? " --standalone" : "") - + " --from " + from + " --to " + to; - document.getElementById("command").textContent = commandString; }); }; document.getElementById("convert").onclick = newpage;