SF.net SVN: docutils:[10231] trunk/docutils/docutils

milde--- via Docutils-checkins <[email protected]> Thu, 11 Sep 2025 14:16:34 +0000
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 10231
          http://sourceforge.net/p/docutils/code/10231
Author:   milde
Date:     2025-09-11 14:16:33 +0000 (Thu, 11 Sep 2025)
Log Message:
-----------
Small editorial changes.

Add type info, shorten function call, merge repetitive commands.

Modified Paths:
--------------
    trunk/docutils/docutils/parsers/rst/states.py
    trunk/docutils/docutils/writers/latex2e/__init__.py

Modified: trunk/docutils/docutils/parsers/rst/states.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/states.py	2025-09-11 09:29:43 UTC (rev 10230)
+++ trunk/docutils/docutils/parsers/rst/states.py	2025-09-11 14:16:33 UTC (rev 10231)
@@ -229,7 +229,7 @@
     nested_sm = NestedStateMachine
     nested_sm_cache = []
 
-    def __init__(self, state_machine, debug=False) -> None:
+    def __init__(self, state_machine: RSTStateMachine, debug=False) -> None:
         self.nested_sm_kwargs = {'state_classes': state_classes,
                                  'initial_state': 'Body'}
         StateWS.__init__(self, state_machine, debug)
@@ -354,8 +354,8 @@
 
         # run the state machine and populate `node`:
         block_length = len(block)
-        my_state_machine.run(block, input_offset, memo=self.memo,
-                             node=node, match_titles=match_titles)
+        my_state_machine.run(block, input_offset, self.memo,
+                             node, match_titles)
 
         if match_titles:
             if node == self.state_machine.node:

Modified: trunk/docutils/docutils/writers/latex2e/__init__.py
===================================================================
--- trunk/docutils/docutils/writers/latex2e/__init__.py	2025-09-11 09:29:43 UTC (rev 10230)
+++ trunk/docutils/docutils/writers/latex2e/__init__.py	2025-09-11 14:16:33 UTC (rev 10231)
@@ -2761,8 +2761,7 @@
                      *self.ids_to_labels(node, set_anchor=False, newline=True),
                      f'\\end{{{math_env}}}']
         if node['classes']:
-            self.out.append('\n')
-            self.out.append('}' * len(node['classes']))
+            self.out.append('\n' + '}' * len(node['classes']))
         raise nodes.SkipNode  # content already processed
 
     def depart_math_block(self, node) -> None:

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.