summaryrefslogtreecommitdiff
path: root/remove-tags.sh
blob: 3640d277a657298b2e63c2442bcb92e22f763c79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

sed '
  s/>/>\n/g
  s/</\n</g
' \
  | sed -n '
    /^<!--.*>$/ d
    /^<!--/,/-->$/ d
    /^<script[ >]/,\,^</script>$, d
    /^<body\(>$\|\s\)/,\,^</body>$, p
  ' \
  | sed '
    s/<[^<>]*>//g
  '