diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/Makefile | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 9c9bbfe375d..65ed32cd0ab 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -194,7 +194,7 @@ MAKEINFO = makeinfo ## # Quick syntax check without style processing -check: postgres.sgml $(ALLSGML) check-tabs +check: postgres.sgml $(ALLSGML) check-tabs check-nbsp $(XMLLINT) $(XMLINCLUDE) --noout --valid $< @@ -257,7 +257,15 @@ endif # sqlmansectnum != 7 # tabs are harmless, but it is best to avoid them in SGML files check-tabs: - @( ! grep ' ' $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.xsl) ) || (echo "Tabs appear in SGML/XML files" 1>&2; exit 1) + @( ! grep ' ' $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.xsl) ) || \ + (echo "Tabs appear in SGML/XML files" 1>&2; exit 1) + +# Non-breaking spaces are harmless, but it is best to avoid them in SGML files. +# Use perl command because non-GNU grep or sed could not have hex escape sequence. +check-nbsp: + @ ( $(PERL) -ne '/\xC2\xA0/ and print("$$ARGV:$$_"),$$n++; END {exit($$n>0)}' \ + $(wildcard $(srcdir)/*.sgml $(srcdir)/ref/*.sgml $(srcdir)/*.xsl) ) || \ + (echo "Non-breaking spaces appear in SGML/XML files" 1>&2; exit 1) ## ## Clean |