mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
17 lines
604 B
Bash
17 lines
604 B
Bash
returncode=0
|
|
for FILE in $(ls *.md)
|
|
do
|
|
NB_OPENING=$(grep -E "^ *\`\`\` *\w+ *$" $FILE | wc -l)
|
|
NB_CLOSE=$(grep -E "^ *\`\`\` *$" $FILE | wc -l)
|
|
if [[ "$NB_OPENING" != "$NB_CLOSE" ]]
|
|
then
|
|
echo "There are some mistakes in code block syntax in $FILE ..."
|
|
returncode=1
|
|
fi
|
|
done
|
|
|
|
if [[ $returncode == 1 ]]
|
|
then
|
|
echo "Make sure that all the code block in the problematic files do specific the language in the opening backticks (for example, \`\`\`bash). Otherwise, rendering in the actual website will be broken because of a bug in markdown parsing lib..."
|
|
exit 1
|
|
fi
|