Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / Article-separator.awk
diff options
context:
space:
mode:
1 files changed, 15 insertions, 0 deletions
-rw-r--r--awk-edits/Article-separator.awk15
diff --git a/awk-edits/Article-separator.awk b/awk-edits/Article-separator.awk
new file mode 100644
index 0000000..7365da2
--- /dev/null
+++ b/awk-edits/Article-separator.awk
@@ -0,0 +1,15 @@
+BEGIN {
+ arstarted = 0
+}
+
+/<article>/ {
+ arstarted = 1
+}
+
+arstarted == 1 && /<h1/ {
+ print "<div class=\"section\">"
+}
+
+arstarted == 1 && /<h2/ {
+ print "</div><div class=\"section\">"
+}