1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-07-06 17:46:00 +00:00

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
2026-06-27 03:25:30 +08:00
committed by GitHub
parent b9883fbb4b
commit 764f75e338

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