From 8d1405685572cb63212adce7bd78dc6f6428ba42 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 31 Oct 2016 13:44:12 -0400 Subject: [PATCH] Fix validation tool Signed-off-by: Philippe Proulx --- tools/asciidoc.check.conf | 14 +++++++++++--- tools/check.py | 7 ++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/tools/asciidoc.check.conf b/tools/asciidoc.check.conf index 9b748dc..feaaa0a 100644 --- a/tools/asciidoc.check.conf +++ b/tools/asciidoc.check.conf @@ -2,18 +2,23 @@ note-no-anim="note-no-anim" [macros] -(?su)[\\]?(?Pman):(?P\S*?)\((?P
.*?)\)= +(?su)[\\]?(?Pman):(?P\S*?)\((?P
.+?)\)= +(?su)[\\]?(?Popt):(?P\S*?)\((?P
.+?)\):(?P-[a-zA-Z0-9-]+)= (?su)[\\]?(?Ppath):\{(?P[^}]+)\}= (?su)[\\]?(?Pdir):\{(?P[^}]+)\}= (?su)[\\]?(?Penv):(?P[a-zA-Z0-9_]+)= (?su)[\\]?(?Pcmd):(?P[a-zA-Z0-9_-]+)= +(?su)[\\]?(?Pnoch):\{(?P[^}]+)\}= [man-inlinemacro] - {page} - {section} + {page} + {section} +[opt-inlinemacro] +{opt} + [path-inlinemacro] {path} @@ -26,6 +31,9 @@ note-no-anim="note-no-anim" [cmd-inlinemacro] {var} +[noch-inlinemacro] +{text} + [tabledef-default] style=def def-style=options=("header",) diff --git a/tools/check.py b/tools/check.py index 187cd1c..70bd8d5 100644 --- a/tools/check.py +++ b/tools/check.py @@ -107,13 +107,18 @@ class _Checker: sections_anchors = self._root.findall('.//section') sections_anchors += self._root.findall('.//anchor') sections_anchors += self._root.findall('.//glossary') + sections_anchors += self._root.findall('.//important') + sections_anchors += self._root.findall('.//tip') + sections_anchors += self._root.findall('.//caution') + sections_anchors += self._root.findall('.//warning') + sections_anchors += self._root.findall('.//note') links = self._root.findall('.//link') end_ids = set() for sa in sections_anchors: end_id = sa.get('id') - if end_id is None: + if sa.tag in ('section', 'anchor') and end_id is None: self._perror('Found a section/anchor with no ID', True) end_ids.add(end_id) -- 2.34.1