Escape underscores in more places

This commit is contained in:
hedy 2023-06-13 18:23:48 +08:00
parent bc28109cf1
commit c57a0b87e2
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 2 additions and 2 deletions

View File

@ -6,11 +6,11 @@ echo "# user list"
for user in $(ls /home/ -1 | grep -v \+ | grep -v testuser)
do
if [ "$(stat -c %G "/home/$user")" == "deleted" ];then
echo "<del>~$user</del> ";
echo "<del>~${user//_/\\_}</del> ";
else if [ "$(stat -c %G "/home/$user")" != "banned" ];then
# Escape underscores (note that username is '[a-z][-0-9a-z_]{2,}')
echo "[~${user//_/\\_}](/~$user) ";
else
echo "~$user ([banned](banned.html#$user)) ";
echo "~${user//_/\\_} ([banned](banned.html#$user)) ";
fi;fi
done