script: check link format in nested mediawiki files (#2199)

* script: check link format in nested mediawiki files

Signed-off-by: reflecttypefor <reflecttypefor@outlook.com>
This commit is contained in:
reflecttypefor authored and GitHub committed 2026-06-26 12:25:30 -07:00
1 parent b9883fbb4b
commit 764f75e338
1 file changed
+7 -5
+7 -5
View File
@@ -7,14 +7,16 @@
# Check wrong mediawiki link format
ECODE=0
for fname in *.mediawiki; do
GRES=$(grep -n '](http' "$fname")
while IFS= read -r fname; do
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
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