Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / Header-description.awk
diff options
context:
space:
mode:
Commit0d61f601ee42f137d14e4f559280fcf7cdc0b5e9 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-09-11 11:57:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-09-11 11:57:05 +0300
Files14a0bd208a1aef66e107587a33a71d091dde2455 /awk-edits/Header-description.awk
syndamia.com-0d61f601ee42f137d14e4f559280fcf7cdc0b5e9.tar
syndamia.com-0d61f601ee42f137d14e4f559280fcf7cdc0b5e9.tar.gz
syndamia.com-0d61f601ee42f137d14e4f559280fcf7cdc0b5e9.zip
Parentcad8947e02ce42af4829f96ca4c1a49519dbc8a4 (diff)
[Header-description] Fixed logic
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>"))