Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / Article-separator.awk
blob: 7365da2fa1ca2e39d668d5e5b35cbbbb5603677d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
BEGIN {
	arstarted = 0
}

/<article>/ {
	arstarted = 1
}

arstarted == 1 && /<h1/ {
	print "<div class=\"section\">"
}

arstarted == 1 && /<h2/ {
	print "</div><div class=\"section\">"
}