diff --git a/Makefile b/Makefile index 111a4233da..01a055815c 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,11 @@ endif latest:: @if grep -l ' $$' *.md; then ! echo "Trailing whitespace found"; fi @err=0; for f in draft-*.md ; do \ - line=$$(cat "$$f" | sed -e 's/[|].*[|]//' | wc -L); \ - if [ "$$line" -gt 80 ]; then \ - echo "$$f contains a line with >80 ($$line) characters"; err=1; \ + if grep -n '^.\{81\}' "$$f"; then \ + echo "$$f contains a line with >80 characters"; err=1; \ fi; \ - figure=$$(sed -e '/^~~~/,/^~~~/p;d' "$$f" | wc -L); \ - if [ "$$figure" -gt 69 ]; then \ - echo "$$f contains a figure with >69 ($$figure) characters"; err=1; \ + if cat "$$f" | (l=0; while read -r a; do l=$$(($$l + 1)); echo -E "$$l:$$a"; done) | \ + sed -e '/^[0-9]*:~~~/,/^[0-9]*:~~~/p;d' | grep '^[0-9]*:.\{70\}'; then \ + echo "$$f contains a figure with >69 characters"; err=1; \ fi; \ done; [ "$$err" -eq 0 ]