changeset 18749:8aa053b99c24

minirst: don't generate TH elements for the first row in table We mainly use them for option tables -- browsers bolding and centering them looks wrong.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sat, 09 Feb 2013 21:51:21 +0000
parents 6e676fb6ea44
children c9d923f5d8ae
files mercurial/minirst.py tests/test-help.t tests/test-minirst.py.out
diffstat 3 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/minirst.py	Sun Feb 10 12:58:57 2013 +0100
+++ b/mercurial/minirst.py	Sat Feb 09 21:51:21 2013 +0000
@@ -558,10 +558,7 @@
             for row in table:
                 l = []
                 for v in zip(row):
-                    if not t:
-                        l.append('<th>%s</th>' % v)
-                    else:
-                        l.append('<td>%s</td>' % v)
+                    l.append('<td>%s</td>' % v)
                 t.append(' <tr>%s</tr>\n' % ''.join(l))
             out.append('<table>\n%s</table>\n' % ''.join(t))
         elif btype == 'definition':
--- a/tests/test-help.t	Sun Feb 10 12:58:57 2013 +0100
+++ b/tests/test-help.t	Sat Feb 09 21:51:21 2013 +0000
@@ -1531,7 +1531,7 @@
   options:
   </p>
   <table>
-   <tr><th>-I</th><th>--include PATTERN [+]</th><th>include names matching the given patterns</th></tr>
+   <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
    <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
    <tr><td>-S</td><td>--subrepos</td><td>recurse into subrepositories</td></tr>
    <tr><td>-n</td><td>--dry-run</td><td>do not perform actions, just print output</td></tr>
@@ -1543,7 +1543,7 @@
   global options:
   </p>
   <table>
-   <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></tr>
+   <tr><td>-R</td><td>--repository REPO</td><td>repository root directory or name of overlay bundle file</td></tr>
    <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
    <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
    <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
@@ -1643,7 +1643,7 @@
   options:
   </p>
   <table>
-   <tr><th>-A</th><th>--after</th><th>record delete for missing files</th></tr>
+   <tr><td>-A</td><td>--after</td><td>record delete for missing files</td></tr>
    <tr><td>-f</td><td>--force</td><td>remove (and delete) file even if added or modified</td></tr>
    <tr><td>-I</td><td>--include PATTERN [+]</td><td>include names matching the given patterns</td></tr>
    <tr><td>-X</td><td>--exclude PATTERN [+]</td><td>exclude names matching the given patterns</td></tr>
@@ -1655,7 +1655,7 @@
   global options:
   </p>
   <table>
-   <tr><th>-R</th><th>--repository REPO</th><th>repository root directory or name of overlay bundle file</th></tr>
+   <tr><td>-R</td><td>--repository REPO</td><td>repository root directory or name of overlay bundle file</td></tr>
    <tr><td></td><td>--cwd DIR</td><td>change working directory</td></tr>
    <tr><td>-y</td><td>--noninteractive</td><td>do not prompt, automatically pick the first choice for all prompts</td></tr>
    <tr><td>-q</td><td>--quiet</td><td>suppress output</td></tr>
--- a/tests/test-minirst.py.out	Sun Feb 10 12:58:57 2013 +0100
+++ b/tests/test-minirst.py.out	Sat Feb 09 21:51:21 2013 +0000
@@ -758,7 +758,7 @@
 html format:
 ----------------------------------------------------------------------
 <table>
- <tr><th>a</th><th>b</th><th>c</th></tr>
+ <tr><td>a</td><td>b</td><td>c</td></tr>
  <tr><td>1</td><td>2</td><td>3</td></tr>
  <tr><td>foo</td><td>bar</td><td>baz this list is very very very long man</td></tr>
 </table>