mirror of
https://codeberg.org/TicklishHoneyBee/CLIte.git
synced 2026-03-11 09:04:37 +00:00
in htmLEncode, only replace space with on the last character in string
This commit is contained in:
parent
c543504387
commit
ac2f7f813d
1 changed files with 4 additions and 5 deletions
|
|
@ -1290,11 +1290,10 @@ clite.shell = {
|
|||
clite.lib = {
|
||||
// makes text html safe
|
||||
htmlEncode:function(txt) {
|
||||
return txt
|
||||
.replace(/&/g, '&')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/</g, '<')
|
||||
.replace(/ /g, ' ');
|
||||
var rtxt = txt.replace(/&/g, '&').replace(/>/g, '>').replace(/</g, '<');
|
||||
if (rtxt.length > 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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue