[PATCH 5 of 6] minirst: HTML formatter tweaks
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Sat Feb 9 08:02:19 CST 2013
On Sat, Feb 09, 2013 at 01:00:39PM +0000, Dan Villiom Podlaski Christiansen wrote:
> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
> # Date 1360414106 0
> # Node ID 45b34ea40358b6f8fe14ef874ebbc5de5556f23c
> # Parent 675a399c2c9d5c94d4798bc8fd11f855eaff5672
> minirst: HTML formatter tweaks
>
> - output table rows on distinct lines
> - don't make the first row a table header
You should make the reason for this change clear.
Are you sure it does not break any other valid usage ?
(note: two changes in a patches, but pretty related)
>
> diff --git a/mercurial/minirst.py b/mercurial/minirst.py
> --- a/mercurial/minirst.py
> +++ b/mercurial/minirst.py
> @@ -546,11 +546,8 @@ def formathtml(blocks):
> 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)
> - t.append(' <tr>%s</tr>\n' % ''.join(l))
> + l.append('<td>%s</td>' % v)
> + t.append(' <tr>%s</tr>\n' % '\n'.join(l))
> out.append('<table>\n%s</table>\n' % ''.join(t))
> elif btype == 'definition':
> openlist('dl', level)
> diff --git a/tests/test-minirst.py.out b/tests/test-minirst.py.out
> --- a/tests/test-minirst.py.out
> +++ b/tests/test-minirst.py.out
> @@ -758,9 +758,15 @@ 30 column format:
> html format:
> ----------------------------------------------------------------------
> <table>
> - <tr><th>a</th><th>b</th><th>c</th></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>
> + <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>
> ----------------------------------------------------------------------
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list