Hi all,

Wanting to have the MOM documentation on my e-reader, i couldn't find a single-file PDF or EPUB version, so i tried using pandoc to convert the HTML files to an EPUB. However, pandoc kept aborting due to the invalid markup in several of the files, resulting in multiple 'TagClose: "div"' errors.

The attached diff includes what i needed to do in order to avoid these errors (and perhaps some theoretically-unneeded fixes as well). It doesn't address many other markup errors reported by Emacs' nXML mode, most of which are "Element not allowed in this context" and "Unknown element" errors. The latter were caused by the use of '<nobr>'; i gather one one is supposed to instead use the 'white-space' CSS property.


Alexis.

diff --git a/contrib/mom/momdoc/docelement.html b/contrib/mom/momdoc/docelement.html
index 161650f7..70316b26 100644
--- a/contrib/mom/momdoc/docelement.html
+++ b/contrib/mom/momdoc/docelement.html
@@ -453,7 +453,7 @@ though, if a tag has control macros for
   <td style="padding-right: 1em">QUAD</td>
   <td style="padding-right: 1em">CAPS</td>
   </tr>
-<table>
+</table>
 those parameters may be used within an
 <kbd>&lt;element&gt;_STYLE</kbd> macro.
 </p>
@@ -1163,7 +1163,7 @@ a particular heading level just because its style appeals to you.
 
 <div class="box-macro-args">
 Macro: <b>HEADING</b> <kbd class="macro-args">&lt;level&gt; [
-PARAHEAD ] [ NAMED &lt;pdf-id&gt; ] &quot;&lt;heading text&gt;&quot;
+PARAHEAD ] [ NAMED &lt;pdf-id&gt; ] &quot;&lt;heading text&gt;&quot;</kbd>
 </div>
 
 <p>
@@ -1484,7 +1484,7 @@ representing the chapter number.
 After you invoke <kbd>.PREFIX_CHAPTER_NUMBER</kbd>, mom will prepend
 the chapter number to all headings you have requested be numbered
 with
-<a href="#heading-style"><kbd>.HEADING_STYLE &lt;n&gt; NUMBER</a>.
+<a href="#heading-style"><kbd>.HEADING_STYLE &lt;n&gt; NUMBER</kbd></a>.
 Thus, assuming chapter number twelve (12):
 <br/>
 <span class="pre-in-pp">
@@ -2294,7 +2294,7 @@ ITALIC_MEANS_ITALIC is enabled (see
 <h2 id="blockquote-intro" class="macro-group">Blockquotes (cited material)</h2>
 
 <ul style="margin-left: -.5em;">
-  <li><a href="#blockquote-description">Introduction</a>
+  <li><a href="#blockquote-description">Introduction</a></li>
   <li><a href="#blockquote">Tag: BLOCKQUOTE</a></li>
   <li><a href="#blockquote-control">BLOCKQUOTE control macros</a></li>
 </ul>
diff --git a/contrib/mom/momdoc/docprocessing.html b/contrib/mom/momdoc/docprocessing.html
index 3d10a43e..5169b7d9 100644
--- a/contrib/mom/momdoc/docprocessing.html
+++ b/contrib/mom/momdoc/docprocessing.html
@@ -65,7 +65,7 @@ FDL in the main directory of the groff source package.
     <li><a href="#covertitle">COVERTITLE</a></li>
     <li><a href="#doc-covertitle">DOC_COVERTITLE</a></li>
     <li><a href="#pdftitle">PDF_TITLE</a></li>
-    <li><a href="#toc-heading">TOC_HEADING</li>
+    <li><a href="#toc-heading">TOC_HEADING</a></li>
   </ul></li>
   <li><a href="#docstyle-macros"><b>The docstyle macros (templates)</b></a>
   <ul class="toc-docproc">
@@ -80,7 +80,7 @@ FDL in the main directory of the groff source package.
     <li><a href="#copystyle">COPYSTYLE</a></li>
   </ul></li>
   <li><a href="cover.html"><b>Cover pages</b></a>
-  <li><a href="#docheader"><b>Managing the document header</b></a>
+  <li><a href="#docheader"><b>Managing the document header</b></a></li>
   <ul class="toc-docproc">
     <li><a href="#docheader">DOCHEADER</a></li>
     <li><a href="#docheader-control">Docheader control</a>
@@ -405,7 +405,7 @@ The solution is simply to add <kbd>.SPACE&nbsp;-1v</kbd> or
 </div>
 
 <div class="box-macro-args">
-Macro: <b>NO_SHIM</b> <kbd class="macro-args">&lt;none&gt; | &lt;anything&gt;
+Macro: <b>NO_SHIM</b> <kbd class="macro-args">&lt;none&gt; | &lt;anything&gt;</kbd>
 </div>
 
 <p>
@@ -900,7 +900,7 @@ processing macros.
 </div>
 
 <div class="box-macro-args">
-Macro: <b>TITLE</b> <kbd class=marco-args>[COVER | DOC_COVER] &quot;&lt;title string&gt;&quot; [&quot;&lt;2nd line&gt;&quot; [&quot;&lt;3rd line&gt;&quot; ... ] ]</kbd> 
+Macro: <b>TITLE</b> <kbd class=marco-args">[COVER | DOC_COVER] &quot;&lt;title string&gt;&quot; [&quot;&lt;2nd line&gt;&quot; [&quot;&lt;3rd line&gt;&quot; ... ] ]</kbd> 
 </div>
 <p class="requires">
 &bull;&nbsp;Arguments must be enclosed in double-quotes
@@ -1823,7 +1823,7 @@ and revision information in the headers) or a final copy.
 <h3 id="index-docstyle" class="macro-list">Docstyle macros</h3>
 <ul class="macro-list">
   <li><a href="#doctype">DOCTYPE</a>
-  <li><a href="#printstyle">PRINTSTYLE</a> &ndash; non-optional macro required for document processing
+  <li><a href="#printstyle">PRINTSTYLE</a> &ndash; non-optional macro required for document processing</li>
   <ul style="margin-left: -.5em; list-style-type: disc;">
     <li><a href="#typeset-defaults">Defaults for PRINTSTYLE TYPESET</a></li>
     <li><a href="#typewrite-defaults">Defaults for PRINTSTYLE TYPEWRITE</a>
@@ -2068,7 +2068,6 @@ inline escape to change point size in the strings
 passed to HEADER or FOOTER.  Prefer either mom&#8217;s
 <kbd><nobr>\*S[&plusmn;n]</nobr></kbd> or groff&#8217;s
 <kbd><nobr>\s[&plusmn;n]</nobr></kbd>.
-</span>
 </p>
 </div>
 
@@ -2123,7 +2122,6 @@ Not all PDF viewers support all modes.  Any that are not supported
 are replaced by the &#8220;R&#8221; mode, which simply replaces one
 slide with the next unless the PDF viewer has a different default
 transition mode.
-</span>
 </p>
 </div>
 
@@ -2453,7 +2451,7 @@ particularly useful for reducing the point size of
 headers/footers should they become crowded (quite likely to
 happen if the title of your document is long and your
 <a href="#copystyle">COPYSTYLE</a>
-is <kbd>DRAFT</kbd).
+is <kbd>DRAFT</kbd>).
 </p>
 
 <p class="tip-bottom">
diff --git a/contrib/mom/momdoc/images.html b/contrib/mom/momdoc/images.html
index 8e381873..f7314006 100644
--- a/contrib/mom/momdoc/images.html
+++ b/contrib/mom/momdoc/images.html
@@ -54,7 +54,7 @@ FDL in the main directory of the groff source package.
       <li><a href="#pdf-image-frame">PDF_IMAGE_FRAME</a>&mdash;set parameters for image frames</li>
     </ul></li>
     <li><a href="#pspic">The PSPIC macro</a></li>
-  </ul>
+  </ul></li>
   <li><a href="#floats-intro">Floats</a>
   <ul>
     <li><a href="#float">The FLOAT macro</a></li>
@@ -83,7 +83,7 @@ FDL in the main directory of the groff source package.
     <ul style="margin-left: -1em;">
     </ul></li>
     <li><a href="#refer">refer</a></li>
-  </ul>
+  </ul></li>
   <li><a href="#captions-and-labels">Captions and labels</a>
     <ul>
       <li><a href="#autolabel">AUTOLABEL</a></li>
@@ -108,7 +108,7 @@ FDL in the main directory of the groff source package.
       <li><a href="#box-notes">Additional notes on box usage and behaviour</a></li>
         <ul>
          <li><a href="#qbef">QUOTE, BLOCKQUOTE, EPIGRAPH, FLOAT</a></li>
-         <li><a href="#code">CODE</li>
+         <li><a href="#code">CODE</a></li>
          <li><a href="#quotes">Description of boxed BLOCKQUOTEs and EPIGRAPHs</a></li>
          <ul style="margin-left: -1em; list-style: disc;">
            <li><a href="#leftover">Leftover box syndrome</a></li>
@@ -119,6 +119,7 @@ FDL in the main directory of the groff source package.
       <li><a href="#page-color-intro">Page colour</a></li>
     </ul>
   </li>
+</ul>
 </div>
 
 <div class="rule-medium"><hr/></div>
@@ -137,7 +138,7 @@ containing PDF and EPS images must be processed, hence documents may
 not contain a mix.
 </p>
 
-<h3 id=converting class="docs">Image conversion and file processing</h3>
+<h3 id="converting" class="docs">Image conversion and file processing</h3>
 
 <p>
 When your image files are not in PDF or EPS format&mdash;jpgs,
@@ -244,7 +245,7 @@ Unlike
 which it resembles, PDF_IMAGE requires that the pdf image&#8217;s
 dimensions (the bounding box,
 <a href="#bounding-box">see below</a>)
-be supplied each time it&#8217;s called.</p>
+be supplied each time it&#8217;s called.
 </p>
 
 <p>
@@ -411,8 +412,8 @@ linked to from other places in the file (with PDF_LINK; see
 </p>
 
 <p>
-<b><i>Please note:</b> The following functionality is available
-only with groff 1.22.4 or later.</i>
+<b><i>Please note:</i></b> The following functionality is available
+only with groff 1.22.4 or later.
 </p>
 
 <p>
@@ -1040,7 +1041,7 @@ is 1/4 linespace.
 </div>
 
 <div class="box-macro-args">
-Macro: <b>LABEL</b></a>
+Macro: <b>LABEL</b>
 <kbd class="macro-args">"&lt;label&gt;" [ CAPTION "&lt;caption&gt;" ] [ SHORT_CAPTION ] \
 <br/>
 [ TO_LIST FIGURES | TABLES | EQUATIONS ]</kbd>
@@ -1181,7 +1182,8 @@ give <kbd>\&</kbd> as the first argument to LABEL, followed by
 <br/>
 <span class="pre-in-pp">
   .LABEL \& \
-   CAPTION "caption"
+  CAPTION "caption"
+</span>
 </p>
 
 <div class="box-tip">
@@ -1202,6 +1204,7 @@ List of Examples with
 <br/>
 <span class="pre-in-pp">
   .TO_FIGURES EQUATIONS
+</span>
 </p>
 </div>
 
@@ -1210,7 +1213,7 @@ List of Examples with
 </div>
 
 <div class="box-macro-args">
-Macro: <b>CAPTION</b></a>
+Macro: <b>CAPTION</b>
 <kbd class="macro-args">"&lt;caption&gt;" \
 <br/>
 [ "&lt;additional line&gt;" [ "&lt;additional line&gt;"... ] ] \
@@ -1452,7 +1455,7 @@ required)
 <br/>
 Macro: <a href="#th"><b>TH</b></a> <kbd class="macro-args">(optional, only if .TS H)</kbd>
 <br/>
-Macro: <a href="#te"><b>TE</b></a> <kbd class="macro-args">[ SOURCE "&lt;text of table source&gt;" ]
+Macro: <a href="#te"><b>TE</b></a> <kbd class="macro-args">[ SOURCE "&lt;text of table source&gt;" ]</kbd>
 </div>
 
 <p>
@@ -1707,8 +1710,8 @@ linked to from other places in the file (with PDF_LINK; see
 </p>
 
 <p>
-<b><i>Please note:</b> The following functionality is available
-only with groff 1.22.4 or later.</i>
+<b><i>Please note:</i></b> The following functionality is available
+only with groff 1.22.4 or later.
 </p>
 
 <p>
@@ -1992,8 +1995,8 @@ linked to from other places in the file (with PDF_LINK; see
 </p>
 
 <p>
-<b><i>Please note:</b> The following functionality is available
-only with groff 1.22.4 or later.</i>
+<b><i>Please note:</i></b> The following functionality is available
+only with groff 1.22.4 or later.
 </p>
 
 <p>
@@ -2017,7 +2020,7 @@ labels, the same string in, say, chapter 5 would produce the pdf
 link &#8220;Figure 5.3&#8221;.
 </p>
 
-<!---PIC_TEXT_STYLE--->
+<!-- PIC_TEXT_STYLE -->
 
 <div class="macro-id-overline">
 <h3 id="pic-text-style" class= "macro-id">PIC_TEXT_STYLE</h3>
@@ -2152,7 +2155,7 @@ required)
 <br/>
 &nbsp;&nbsp;[ TARGET "&lt;name&gt;" ]
 <br/>
-Macro: <a href="#en"><b>EN</b></a> <kbd class="macro-args"> [ CONTINUED | CONT | ... ]</kbd>
+&nbsp;&nbsp;[ CONTINUED | CONT | ... ]</kbd>
 </div>
 
 <div class="box-tip">
@@ -2237,7 +2240,6 @@ the page.  If there are no others, the final equation should be
 flex-spaced, i.e. not given the <kbd>NO_FLEX</kbd> argument.
 </p>
 
-</p>
 <h5 class="docs" style="margin-top: 1em; text-transform: none">CAPTION</h5>
 
 <p>
@@ -2287,8 +2289,8 @@ be linked to from other places in the file (with PDF_LINK; see
 </p>
 
 <p>
-<b><i>Please note:</b> The following functionality is available
-only with groff 1.22.4 or later.</i>
+<b><i>Please note:</i></b> The following functionality is available
+only with groff 1.22.4 or later.
 </p>
 
 <p>
@@ -2435,7 +2437,7 @@ Tables.
 Autolabelling may be disabled on-the-fly by giving any argument
 other than <kbd>PREFIX</kbd>, <kbd>SUFFIX</kbd>, or
 <kbd>PREFIX_CHAPTER</kbd> to the appropriate macro.  For example,
-</br>
+<br/>
 <span class="pre-in-pp">
   .AUTOLABEL_IMAGES NO
 </span>
@@ -2515,6 +2517,7 @@ If you do not supply the <kbd>PREFIX_CHAPTER</kbd> argument, the
 label number is <i>not</i> reset automatically.  To reset it, invoke
 <kbd>.AUTOLABEL_&lt;type&gt;</kbd> after each
 <a href="docprocessing.html#collate">COLLATE</a>.
+</p>
 </div>
 
 <div id="set-autolabel" class="box-macro-args" style="margin-top: .5em">
@@ -2555,8 +2558,7 @@ means the next autolabelled Figure will be &#8220;Fig. 6.&#8221;
 </div>
 
 <div class="box-macro-args" style="margin-top: .5em">
-Macro: <b>CAPTION_AFTER_LABEL</b> <kbd class="macro-args">IMG | PIC | TBL | ALL [ &lt;anything&gt;</kbd> ]
-</kbd>
+Macro: <b>CAPTION_AFTER_LABEL</b> <kbd class="macro-args">IMG | PIC | TBL | ALL [ &lt;anything&gt; ]</kbd>
 </div>
 
 <p>
@@ -2615,8 +2617,7 @@ Rather, you must do
 </div>
 
 <div class="box-macro-args" style="margin-top: .5em">
-Macro: <b>MLA</b> <kbd class="macro-args"> [ &lt;anything&gt;</kbd> ]
-</kbd>
+Macro: <b>MLA</b> <kbd class="macro-args"> [ &lt;anything&gt; ]</kbd>
 </div>
 
 <p>
@@ -2886,6 +2887,7 @@ Macro: <b>LIST_OF_TABLES</b>
 <kbd class="macro-args">Arguments:
 <br/>
 &nbsp;&nbsp;[ TITLE_STRING "&lt;string&gt;" ] [ START_PAGENUM &lt;page number&gt; ]
+</kbd>
 </div>
 
 <p>
@@ -3182,7 +3184,7 @@ Arguments:
 </kbd>
 </div>
 
-</p>
+<p>
 Without arguments, BOX begins a shaded grey background.
 The material inside is inset by one
 <a href="definitions.html#picaspoints">pica</a>.
@@ -3359,7 +3361,7 @@ require that boxes be started <i>after</i> they are
 invoked and stopped just before they are toggled off:
 <span class="pre-in-pp">
 &nbsp;&nbsp;.QUOTE
-&nbsp;&nbsp;.BOX <parameters>
+&nbsp;&nbsp;.BOX &lt;parameters&gt;
 &nbsp;&nbsp;Text of quote
 &nbsp;&nbsp;.BOX OFF
 &nbsp;&nbsp;.QUOTE OFF
@@ -3465,11 +3467,11 @@ in printed documents, it can be effective in
 </div>
 
 <div id="box-macro" class="box-macro-args" style="margin-top: .5em">
-Macro: <b>PAGE_COLOR</b> <kbd class="macro-args"> &lt;color&gt; | OFF | off
+Macro: <b>PAGE_COLOR</b> <kbd class="macro-args"> &lt;color&gt; | OFF | off</kbd>
 </div>
 <p class="requires" style="font-style: normal">
 <i>Aliased as</i> <kbd>PAGE_COLOUR</kbd>, <kbd>SLIDE_COLOR</kbd>,
-<i>and</i> <kbd>SLIDE_COLOUR</kbd.
+<i>and</i> <kbd>SLIDE_COLOUR</kbd>.
 </p>
 
 <p>
diff --git a/contrib/mom/momdoc/typesetting.html b/contrib/mom/momdoc/typesetting.html
index 4e0acfe1..c31078cf 100644
--- a/contrib/mom/momdoc/typesetting.html
+++ b/contrib/mom/momdoc/typesetting.html
@@ -2680,10 +2680,9 @@ Inline: <kbd class="macro-args">\*[SLANTX</kbd>]
 </div>
 
 <p>
-<kbd class="macro-args">\*[SLANT]</kbd> begins pseudo-italicizing
-<type. kbd class="macro-args"><nobr>\*[SLANTX]</nobr></kbd> turns
-<the feature off.  Both are a href="definitions.html#inlines">inline
-<escapes</a>,
+<kbd class="macro-args">\*[SLANT]</kbd> begins pseudo-italicizing. <kbd class="macro-args"><nobr>\*[SLANTX]</nobr></kbd> turns
+the feature off.  Both are <a href="definitions.html#inlines">inline
+escapes</a>,
 therefore they should not appear as separate lines, but rather be
 embedded in text lines, like this:
 <br/>
@@ -2768,7 +2767,7 @@ Inline: <kbd class="macro-args">\*[BOLDERX]</kbd>
 <p>
 <kbd class="macro-args">\*[BOLDER]</kbd> begins emboldening type.
 <kbd class="macro-args"><nobr>\*[BOLDERX]</nobr></kbd> turns the
-<kbd class="macro-args">feature off.  Both are
+feature off.  Both are
 <a href="definitions.html#inlines">inline escapes</a>,
 therefore they should not appear as separate lines, but rather be
 embedded in text lines, like this:
diff --git a/contrib/mom/momdoc/version-2.html b/contrib/mom/momdoc/version-2.html
index 219b499b..b7d12007 100644
--- a/contrib/mom/momdoc/version-2.html
+++ b/contrib/mom/momdoc/version-2.html
@@ -213,7 +213,7 @@ may now be given in any order.
 <p>
 The 1.x macros HEAD, SUBHEAD, SUBSUBHEAD, are now deprecated and
 have been replaced by the single macro
-<a href="docelement.html#heading">HEADING <kbd>&lt;n&gt;<kbd></a>,
+<a href="docelement.html#heading">HEADING <kbd>&lt;n&gt;</kbd></a>,
 where <kbd>&lt;n&gt;</kbd> is the heading level.  The deprecated
 macros may still be used, and conform in style to their original
 defaults; they are, however, wrappers around HEADING levels 1
@@ -243,7 +243,7 @@ will abort with an informational message whenever she encounters
 The macro for setting margin note parameters,
 <a href="docelement.html#mn-init">MN_INIT</a>,
 has been re-written such that each parameter now has the form
-<kbd>&lt;PARAMETER&gt &lt;value&gt;</kbd>.  This differs
+<kbd>&lt;PARAMETER&gt; &lt;value&gt;</kbd>.  This differs
 from 1.x where parameters were entered without a preceding
 <kbd>&lt;PARAMETER&gt;</kbd> flag.  Parameters may be entered in any
 order.  Any that are skipped are set to default values.  Documents

Reply via email to