diff --git a/src/web/executor.rs b/src/web/executor.rs index 99e0066..646bb7e 100644 --- a/src/web/executor.rs +++ b/src/web/executor.rs @@ -39,13 +39,20 @@ async fn executor(_state: SharedState, data: ExecutorData) -> ResultCommand exited with code {}", exit_status).as_str(); + } else { + stdout += "Command exited with code 0"; + } + + let stdout = stdout.replace('\n', "
"); Ok(Box::new(warp::reply::json(&stdout))) } diff --git a/static/script/executor.js b/static/script/executor.js index 9211398..a905763 100644 --- a/static/script/executor.js +++ b/static/script/executor.js @@ -13,5 +13,5 @@ async function executeCode(code, lang) { } ) const out = await data.json(); - document.getElementById('output').value = out; + document.getElementById('output').innerHTML = out; } diff --git a/templates/index.html b/templates/index.html index 83346fa..108952e 100644 --- a/templates/index.html +++ b/templates/index.html @@ -34,7 +34,7 @@
- +

 {% endblock %}
 
 {% block script %}