summaryrefslogtreecommitdiff
path: root/convert.sed
blob: 797abb6fe1aa525250614326360552a1e156782d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sed -f

# xsltproc --html doesnt understand html5
s:\(</*\)\(section\|header\|nav\|footer\|article\):\1div:g

/data-href/s/&/&amp;/g

# Fix incorrect < and > inside p tags, that is by allowing only
# known tag be surrounded by < and >.
ta
:a
s/<p>\(.*\)<\/p>/\1/
tfix
b

:fix
s/</\&lt;/g
s/>/\&gt;/g

s/&lt;span\([^;]*\)&gt;/<span\1>/g
s/&lt;\/span&gt;/<\/span>/g

s/\&lt;em\&gt;/<em>/g
s/\&lt;\/em\&gt;/<\/em>/g

s:.*:<p>&</p>: