From 877747f4755aeaf8c68576b8c969d26f18078b98 Mon Sep 17 00:00:00 2001 From: Ron Stone Date: Wed, 27 Apr 2022 12:55:24 -0400 Subject: [PATCH] Extend HTML formatting check (r5, r6, dsR6) Find subsitutions enclosed in word boundaries or html tags. e.g " |org| " and "|org|" Signed-off-by: Ron Stone Change-Id: Idd6124399ca44de5e3d0c52c5cff0924bbca50b5 (cherry picked from commit 0137c7db5856e90989d8788cbd95e88c2401f6ea) --- htmlChecks.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htmlChecks.sh b/htmlChecks.sh index edbd7e559..ae35bb804 100755 --- a/htmlChecks.sh +++ b/htmlChecks.sh @@ -32,10 +32,12 @@ if [ ${#INCLUDE_FILES[@]} != 0 ]; then fi echo "Checking for unexpanded substitution errors in output ..." -INCLUDE_FILES=( $(grep -rl --include="*.html" ' |\S\+| ' .) ) + +INCLUDE_FILES=( $(grep -rlo --include="*.html" --exclude="doc_contribute_guide.html" '[>\s]|\S\+|[<\s]' .) ) + if [ ${#INCLUDE_FILES[@]} != 0 ]; then echo -e "Found ${#INCLUDE_FILES[@]} HTML file(s) that may have unexpanded substitution(s):\n${RED}" - grep -r --include="*.html" ' |\S\+| ' . | awk -F: '{if(f!=$1)print ""; f=$1; print $0;}' + grep -ro --include="*.html" --exclude="doc_contribute_guide.html" '[>\s]|\S\+|[<\s]' . | awk -F: '{if(f!=$1)print ""; f=$1; print $0;}' echo -e "${NC}\nCorrect the issue(s) in the corresponding rST file(s).\nHINT: Substitions are not allowed in code blocks, :ref:s,\n:doc:s, or within rST markup such as **, \`\`, and so on." error=1 fi