diff --git a/tests/test_docs.sh b/tests/test_docs.sh index 3b5855e41..9b85b027a 100755 --- a/tests/test_docs.sh +++ b/tests/test_docs.sh @@ -8,14 +8,32 @@ format_issues=$? failed=0 +# Check for the presence of the "!!!" or "???" markers in the files +# the consecutive non-empty line must begin with 4 spaces while read -r file; do awk -v fname="$file" ' /^(!!!|\?\?\?)/ { current_line_number = NR current_line = $0 - if (getline nextLine <= 0 || nextLine !~ /^ /) { + found_next_content = 0 + while (getline nextLine > 0) { + # Skip empty lines + if (nextLine ~ /^$/) { + continue + } + found_next_content = 1 + if (nextLine !~ /^ /) { + print "File:", fname + print "Error in Line ", current_line_number, "Expected next non-empty line to start with 4 spaces" + print ">>", current_line + print "------" + exit 1 + } + break + } + if (!found_next_content) { print "File:", fname - print "Error in Line ", current_line_number, "Expected next line to start with 4 spaces" + print "Error in Line ", current_line_number, "Found marker but no content following it" print ">>", current_line print "------" exit 1