From 2b1c1e657a9e231a3fdb4f21578e7b2d520fc64f Mon Sep 17 00:00:00 2001 From: Lennart Regebro Date: Thu, 12 Oct 2017 10:41:55 -0400 Subject: [PATCH] Initialize _fieldlist_row_index just like _table_row_index visit_field can be called before visit_field_list if the field list is at the beginning of the document. By initializing _fieldlist_row_index in __init__ this is supported. Closes #4145 --- sphinx/writers/html.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 6dd8bafe5..8d02793e3 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -89,6 +89,7 @@ class HTMLTranslator(BaseTranslator): self.param_separator = '' self.optional_param_level = 0 self._table_row_index = 0 + self._fieldlist_row_index = 0 self.required_params_left = 0 def visit_start_of_file(self, node):