more sophisticated escape_upphtml in gmi2upphtml

This commit is contained in:
2026-06-18 19:07:45 +01:00
parent af4adc0fc8
commit 2328446520
+8 -1
View File
@@ -53,7 +53,14 @@ close_all_open_blocks()
escape_upphtml() escape_upphtml()
{ {
echo "$1" | sed "s/\`/\\\\\`/g" | sed "s/\"/\\\\\"/g" | sed "s/\\\$/\\\\\$/g" echo "$1" \
| sed "s/&/\\&/g" \
| sed "s/</\\&lt;/g" \
| sed "s/>/\\&gt;/g" \
| sed "s/\"/\\&quot;/g" \
| sed "s/'/\\&#x27;/g" \
| sed "s/\`/\\&#x60;/g" \
| sed "s/\\\$/\\\\\$/g"
} }
close_all_open_blocks_except() close_all_open_blocks_except()