From 8cdc5ef45bcf7e69ff5c77edb5079da0725a5e91 Mon Sep 17 00:00:00 2001 From: deleterium Date: Thu, 7 Mar 2024 22:47:00 -0300 Subject: [PATCH] Candy to easy toggle new lines during development. --- debug.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/debug.html b/debug.html index 936f307..560c45b 100644 --- a/debug.html +++ b/debug.html @@ -46,8 +46,18 @@ } } + function toggleNewLines () { + const sourceCode = document.getElementById('sourcecode').value; + if (sourceCode.includes('\\n')) { + document.getElementById('sourcecode').value = sourceCode.replace(/\\n/g, '\n') + return + } + document.getElementById('sourcecode').value = sourceCode.replace(/\n/g, '\\n') + } + window.onload = () => { document.getElementById("compile").addEventListener('click', compileCode); + document.getElementById("toggleNL").addEventListener('click', toggleNewLines); startUpTest(); } @@ -93,7 +103,9 @@
-
+
+ +