home
·
contact
·
privacy
projects
/
redo-blog
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
c90e077dc9a37dc444c9a2d778d045fcc1c11e20
[redo-blog]
/
processor
/
helpers.sh
1
#!/bin/sh
2
3
escape_html()
4
{
5
out=`python3 -c 'import sys, html; print(html.escape(sys.argv[1]))' "$1"`
6
printf "%s" "$out"
7
}
8
9
read_and_escape_file()
10
{
11
in=`cat "$1"`
12
escape_html "$in"
13
}
14
15
escape_url()
16
{
17
out=`python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1]))' "$1"`
18
printf "%s" "$out"
19
}