Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / Header-description.awk
diff options
context:
space:
mode:
1 files changed, 2 insertions, 1 deletions
-rw-r--r--awk-edits/Header-description.awk3
diff --git a/awk-edits/Header-description.awk b/awk-edits/Header-description.awk
index cdadf4d..f7c6ff4 100644
--- a/awk-edits/Header-description.awk
+++ b/awk-edits/Header-description.awk
@@ -28,7 +28,8 @@ BEGIN {
# Loop over the whole file, extract all text in first couple of paragraphs,
# store it in desc (but no more than 200 characters will be saved)
while(getline < ARGV[1]) {
- if ((index($0, "<h1") || index($0, "<h2")) && substr($0, RSTART, 17) != "<h2 id=\"contents\"")
+ start = index($0, "<h2")
+ if (start && substr($0, start, 16) != "<h2 id=\"contents")
break;
if (index($0, "<p>"))