removing del and control characters from the text

This commit is contained in:
nadrad 2022-09-16 14:31:09 +02:00
parent a29fddffe3
commit 13b5f6c165

34
h-m-m
View file

@ -315,11 +315,16 @@ function decode_tree($lines, $root_id, $start_id)
foreach ($lines as $lid=>$line) foreach ($lines as $lid=>$line)
{ {
$lines[$lid] = $lines[$lid] =
str_replace mb_ereg_replace
( (
[ "\t", "\n", "\r", BOM ] "[\000-\040\177".BOM."]"
,[ " ", " ", " ", "" ] ,''
,$lines[$lid] ,str_replace
(
[ "\t", "\n", "\r" ]
,[ " ", " ", " " ]
,$lines[$lid]
)
) )
; ;
@ -1147,7 +1152,7 @@ function edit_node(&$mm, $rewrite = false)
while(true) while(true)
{ {
usleep(10000); usleep(5000);
$in = fread(STDIN, 9); $in = fread(STDIN, 9);
if ($in != '') if ($in != '')
@ -1278,15 +1283,15 @@ function edit_node(&$mm, $rewrite = false)
$content = $content =
trim trim
( (
str_replace mb_ereg_replace
( (
"\n", "[\000-\040\177".BOM."]"
" ", ,''
str_replace ,str_replace
( (
"\t", ["\n", "\r", "\t"]
" ", ,[" ", "", " " ]
get_from_clipboard($mm) ,get_from_clipboard($mm)
) )
) )
); );
@ -1326,9 +1331,10 @@ function edit_node(&$mm, $rewrite = false)
( (
$title $title
,$cursor-1 ,$cursor-1
); )
;
$title = str_replace(BOM,'',$title); $title = mb_ereg_replace("[\000-\040\177".BOM."]",'',$title);
$cursor++; $cursor++;
} }