From ac2f7f813dde3970fd767402e4863436b868b86c Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Sat, 11 Nov 2023 16:57:18 +1000 Subject: [PATCH] in htmLEncode, only replace space with   on the last character in string --- clite/core.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clite/core.js b/clite/core.js index 222bd21..5109bf4 100644 --- a/clite/core.js +++ b/clite/core.js @@ -1290,11 +1290,10 @@ clite.shell = { clite.lib = { // makes text html safe htmlEncode:function(txt) { - return txt - .replace(/&/g, '&') - .replace(/>/g, '>') - .replace(//g, '>').replace(/ 0 && rtxt[rtxt.length-1]) + return rtxt.substring(0,rtxt.length-1)+' '; + return rtxt; }, // returns the file name of a path /tmp/test/foo = foo basename:function(txt) {