Skip to content

Commit

Permalink
Fixes to makechap.py to detect ill-formed headers
Browse files Browse the repository at this point in the history
  • Loading branch information
wsfulton committed May 25, 2018
1 parent a1b1ba1 commit 62814e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Doc/Manual/Doxygen.html
Expand Up @@ -197,7 +197,7 @@ <H3><a name="Doxygen_features"></a>39.2.2 Doxygen-specific %feature directives</
href="Customization.html#Customization_features">%feature directives</a>:
</p>

<h4>doxygen:notranslate</h4>
<h4><a name="Doxygen_notranslate"></a>doxygen:notranslate</h4>

<p>
Turns off translation of Doxygen comments to the target language syntax: the
Expand All @@ -208,7 +208,7 @@ <h4>doxygen:notranslate</h4>
</p>


<h4>doxygen:alias:&lt;command-name&gt;</h4>
<h4><a name="Doxygen_alias"></a>doxygen:alias:&lt;command-name&gt;</h4>

<p>
Specify an alias for a Doxygen command with the given name. This can be useful
Expand Down Expand Up @@ -254,7 +254,7 @@ <h4>doxygen:alias:&lt;command-name&gt;</h4>
</p>


<h4>doxygen:ignore:&lt;command-name&gt;</h4>
<h4><a name="Doxygen_ignore"></a>doxygen:ignore:&lt;command-name&gt;</h4>

<p>
This feature makes it possible to just ignore an unknown Doxygen command, instead of
Expand Down Expand Up @@ -404,14 +404,14 @@ <h4>doxygen:ignore:&lt;command-name&gt;</h4>
</pre></div>


<h4>doxygen:nolinktranslate (Java-only currently)</h4>
<h4><a name="Doxygen_nolinktranslate"></a>doxygen:nolinktranslate (Java-only currently)</h4>

<p>
Turn off automatic link-objects translation.
</p>


<h4>doxygen:nostripparams (Java-only currently)</h4>
<h4><a name="Doxygen_nostripparams"></a>doxygen:nostripparams (Java-only currently)</h4>

<p>
Turn off stripping of <tt>@param</tt> and <tt>@tparam</tt>
Expand Down
4 changes: 3 additions & 1 deletion Doc/Manual/makechap.py
Expand Up @@ -44,6 +44,8 @@ def getheadingname(m):
def getheadingtext(m, s):
prevheadingtext_newstyle = m.group(2)
prevheadingtext_oldstyle = m.group(3)
if prevheadingtext_oldstyle is None or prevheadingtext_newstyle is None:
raise RuntimeError("Ill-formed heading in line:\n%s" % s)
if len(prevheadingtext_oldstyle) == 0 and len(prevheadingtext_newstyle) == 0:
raise RuntimeError("No heading text in line:\n%s" % s)
if len(prevheadingtext_oldstyle) > 0 and len(prevheadingtext_newstyle) > 0:
Expand Down Expand Up @@ -72,7 +74,7 @@ def getheadingtext(m, s):

# Regexs for <h1>,... <h5> sections

h1 = re.compile(r".*?<H1>(<a.*?>\s*[\d\s]*(.*?)</a>)*[\d\s]*(.*?)</H1>", re.IGNORECASE)
h1 = re.compile(r".*?<H1>(<a.*?>\s*[\d\.\s]*(.*?)</a>)*[\d\.\s]*(.*?)</H1>", re.IGNORECASE)
h2 = re.compile(r".*?<H2>(<a.*?>\s*[\d\.\s]*(.*?)</a>)*[\d\.\s]*(.*?)</H2>", re.IGNORECASE)
h3 = re.compile(r".*?<H3>(<a.*?>\s*[\d\.\s]*(.*?)</a>)*[\d\.\s]*(.*?)</H3>", re.IGNORECASE)
h4 = re.compile(r".*?<H4>(<a.*?>\s*[\d\.\s]*(.*?)</a>)*[\d\.\s]*(.*?)</H4>", re.IGNORECASE)
Expand Down

0 comments on commit 62814e4

Please sign in to comment.