diff options
| author | Joe Carstairs <me@joeac.net> | 2026-06-18 19:07:45 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-06-18 19:07:45 +0100 |
| commit | 2328446520781f21f65e290b938f7c13d0533943 (patch) | |
| tree | 3060ed756b5d70fba96400007d3477e8c993e15f | |
| parent | af4adc0fc87a811828a510b9a27b71b2472e5438 (diff) | |
more sophisticated escape_upphtml in gmi2upphtml
| -rwxr-xr-x | http/bin/gmi2upphtml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/http/bin/gmi2upphtml b/http/bin/gmi2upphtml index b43693d..1631037 100755 --- a/http/bin/gmi2upphtml +++ b/http/bin/gmi2upphtml @@ -53,7 +53,14 @@ close_all_open_blocks() escape_upphtml() { - echo "$1" | sed "s/\`/\\\\\`/g" | sed "s/\"/\\\\\"/g" | sed "s/\\\$/\\\\\$/g" + echo "$1" \ + | sed "s/&/\\&/g" \ + | sed "s/</\\</g" \ + | sed "s/>/\\>/g" \ + | sed "s/\"/\\"/g" \ + | sed "s/'/\\'/g" \ + | sed "s/\`/\\`/g" \ + | sed "s/\\\$/\\\\\$/g" } close_all_open_blocks_except() |
