From c9e2cafbc63b9a3e6deef59b1d2657e845023595 Mon Sep 17 00:00:00 2001 From: smerten Date: Mon, 13 Dec 2010 22:06:48 +0000 Subject: [PATCH] For long field names the HTML writer creates two table rows for one field. For the second row the classes are set correctly. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk@6502 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/docutils/writers/html4css1/__init__.py | 4 ++- docutils/test/test_writers/test_html4css1_parts.py | 35 ++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/docutils/docutils/writers/html4css1/__init__.py b/docutils/docutils/writers/html4css1/__init__.py index 9e8ce2bb3..328ee24b3 100644 --- a/docutils/docutils/writers/html4css1/__init__.py +++ b/docutils/docutils/writers/html4css1/__init__.py @@ -858,7 +858,9 @@ class HTMLTranslator(nodes.NodeVisitor): if ( self.settings.field_name_limit and len(node.astext()) > self.settings.field_name_limit): atts['colspan'] = 2 - self.context.append('\n ') + self.context.append('\n' + + self.starttag(node.parent, 'tr', '') + + ' ') else: self.context.append('') self.body.append(self.starttag(node, 'th', '', **atts)) diff --git a/docutils/test/test_writers/test_html4css1_parts.py b/docutils/test/test_writers/test_html4css1_parts.py index 6f25d7c1e..49c89a861 100755 --- a/docutils/test/test_writers/test_html4css1_parts.py +++ b/docutils/test/test_writers/test_html4css1_parts.py @@ -363,6 +363,41 @@ Not a docinfo. \\n''', 'html_head': '''...\\n'''} """], +["""\ +Not a docinfo. + +:This is: a +:simple field list with loooong field: names +""", +"""\ +{'fragment': '''

Not a docinfo.

+ +++ + + + + + + +
This is:a
simple field list with loooong field:
 names
\\n''', + 'html_body': '''
+

Not a docinfo.

+ +++ + + + + + + +
This is:a
simple field list with loooong field:
 names
+
\\n''', + 'html_head': '''...\\n'''} +"""], ]) -- 2.11.4.GIT