[PATCH] Don't add EOL to the end of the footnote text.

MatÄ›j Cepl <[email protected]> Tue, 22 Jul 2025 02:34:11 +0200
Newsgroups gmane.text.docutils.devel
Message-ID <[email protected]>
I was trying to be as conservative as possible (and given the
length 1 of the suffix even .endswith() seemed like an overkill).
---
 docutils/docutils/writers/latex2e/__init__.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docutils/docutils/writers/latex2e/__init__.py b/docutils/docutils/writers/latex2e/__init__.py
index 4b6b0b431..3c9b082e0 100644
--- a/docutils/docutils/writers/latex2e/__init__.py
+++ b/docutils/docutils/writers/latex2e/__init__.py
@@ -2387,6 +2387,8 @@ def visit_footnote_reference(self, node) -> None:
                     self.push_output_collector([])
                     footnote.walkabout(self)
                     text = ''.join(self.out)
+                    if text[-1] == '\n':
+                        text = text[:-1]
                     self.pop_output_collector()
                     break
             else:
-- 
2.50.1