diff --git a/genlog.sh b/genlog.sh
index 727c076..02da0fa 100755
--- a/genlog.sh
+++ b/genlog.sh
@@ -77,7 +77,9 @@ do
while read -r line; do
fixed_line=${line//
# /} # replace '# ' by ''
fixed_line=${fixed_line//<\/h3>/<\/h4>} # replace '
' by '
'
- sed -i "s~$line~$fixed_line~" "$tempdir/body.html"
+ # shellcheck disable=SC2001
+ fixed_line=$(echo "$fixed_line" | sed "s#\\\g") # escape eventual '&'
+ sed -i "s${line}£${fixed_line}£" "$tempdir/body.html"
done <<< "$lines"
# retrieving of the path of the current .gmi file