Commits

Jon Waltman committed 1ba40fb

Prevent indexing commands from causing a paragraph break in Texinfo.

  • Participants
  • Parent commits 662aa5d

Comments (0)

Files changed (1)

File sphinx/writers/texinfo.py

         self.body.append('}')
 
     def visit_index(self, node):
+        # terminate the line but don't prevent paragraph breaks
+        if isinstance(node.parent, nodes.paragraph):
+            self.ensure_eol()
+        else:
+            self.body.append('\n')
         for entry in node['entries']:
             typ, text, tid, text2 = entry
             text = self.escape_menu(text)
-            self.body.append('\n@geindex %s\n' % text)
+            self.body.append('@geindex %s\n' % text)
 
     def visit_refcount(self, node):
         self.body.append('\n')