From 14332848effc0cf6b510651d96469ce6270d90ef Mon Sep 17 00:00:00 2001 From: reflecttypefor Date: Thu, 18 Jun 2026 00:12:17 +0800 Subject: [PATCH 1/2] script: check link format in nested mediawiki files Signed-off-by: reflecttypefor --- scripts/link-format-chk.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/link-format-chk.sh b/scripts/link-format-chk.sh index b0d1484912..17219fda65 100755 --- a/scripts/link-format-chk.sh +++ b/scripts/link-format-chk.sh @@ -7,14 +7,16 @@ # Check wrong mediawiki link format ECODE=0 -for fname in *.mediawiki; do +while IFS= read -r fname; do GRES=$(grep -n '](http' "$fname") if [ "$GRES" != "" ]; then if [ $ECODE -eq 0 ]; then >&2 echo "Github Mediawiki format writes link as [URL text], not as [text](url):" fi ECODE=1 - echo "- $fname:$GRES" + while IFS= read -r line; do + echo "- ${fname#./}:$line" + done <<< "$GRES" fi -done +done < <(find . -type f -name '*.mediawiki' | sort) exit $ECODE From 067b06a20a6539d350344cf61e304e2517a78610 Mon Sep 17 00:00:00 2001 From: reflecttypefor Date: Thu, 18 Jun 2026 15:10:46 +0800 Subject: [PATCH 2/2] script: check link format in nested mediawiki files Signed-off-by: reflecttypefor --- scripts/link-format-chk.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/link-format-chk.sh b/scripts/link-format-chk.sh index 17219fda65..0c91f46646 100755 --- a/scripts/link-format-chk.sh +++ b/scripts/link-format-chk.sh @@ -8,10 +8,10 @@ ECODE=0 while IFS= read -r fname; do - GRES=$(grep -n '](http' "$fname") + GRES=$(grep -nE '\]\((https?://|\.\./bip-|/bip-)' "$fname") if [ "$GRES" != "" ]; then if [ $ECODE -eq 0 ]; then - >&2 echo "Github Mediawiki format writes link as [URL text], not as [text](url):" + >&2 echo "Github Mediawiki format writes links as [URL text], not as [text](URL):" fi ECODE=1 while IFS= read -r line; do