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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user