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

milde--- via Docutils-checkins <[email protected]>
Newsgroups gmane.text.docutils.cvs
Message-ID <[email protected]>
Revision: 9766
          http://sourceforge.net/p/docutils/code/9766
Author:   milde
Date:     2024-06-14 16:19:59 +0000 (Fri, 14 Jun 2024)
Log Message:
-----------
Change "null" writer output from None to the empty string.

Fixes `core.publish_string()`: now returns a `bytes` or `str` instance
for all writers (as advertised).

Modified Paths:
--------------
    trunk/docutils/HISTORY.txt
    trunk/docutils/RELEASE-NOTES.txt
    trunk/docutils/docutils/writers/null.py
    trunk/docutils/test/test_writers/test_null.py

Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt	2024-06-14 16:19:49 UTC (rev 9765)
+++ trunk/docutils/HISTORY.txt	2024-06-14 16:19:59 UTC (rev 9766)
@@ -108,10 +108,10 @@
 
   - Removed. Obsolete in Python 3.
 
-* docutils/writers/latex2e/__init__.py
+* docutils/writers/docutils-xml.py
 
-  - Remove optional argument `pxunit` of `LaTeXTranslator.to_latex_length()`
-    (ignored since at least 2012).
+  - Do not increase indentation of follow-up lines inside inline elements.
+    when formatting with `indents`_.
 
 * docutils/writers/_html_base.py
 
@@ -121,6 +121,11 @@
 
   - Keep default math_output_ value "HTML math.css".
 
+* docutils/writers/latex2e/__init__.py
+
+  - Remove optional argument `pxunit` of `LaTeXTranslator.to_latex_length()`
+    (ignored since at least 2012).
+
 * docutils/writers/manpage.py
 
   - Remove code for unused emdash bullets.
@@ -128,10 +133,9 @@
     docutils version in header
   - Stop converting text to full capitals (bug #481).
 
-* docutils/writers/docutils-xml.py
+* docutils/writers/null.py
 
-  - Do not increase indentation of follow-up lines inside inline elements.
-    when formatting with `indents`_.
+  - `null.Writer.translate()` sets `self.output` to the empty string.
 
 * tools/rst2odt_prepstyles.py
 

Modified: trunk/docutils/RELEASE-NOTES.txt
===================================================================
--- trunk/docutils/RELEASE-NOTES.txt	2024-06-14 16:19:49 UTC (rev 9765)
+++ trunk/docutils/RELEASE-NOTES.txt	2024-06-14 16:19:59 UTC (rev 9766)
@@ -118,13 +118,6 @@
 
     .. _reference-label: docs/user/config.html#reference-label
 
-* "null" writer: output will change to the empty string
-  in Docutils 0.22.
-
-* "manpage" writer:
-
-  - No more changing case in to uppercase, leave it to the source.
-
 Misc
 ----
 
@@ -212,6 +205,16 @@
     Use the long equivalents ``--input-encoding`` and ``--output-encoding``.
     (See `command line interface`_ for the rationale.)
 
+Output changes
+  "manpage" writer:
+     Don't UPPERCASE section headings.
+
+  "null" writer:
+     output changed from None to the empty string.
+
+     `publish_string()` now returns a `bytes` or `str` instance
+     for all writers (as documented).
+
 New objects
   `parsers.docutils_xml`
      parser for `Docutils XML`_ (e.g., the output of the "xml" writer).

Modified: trunk/docutils/docutils/writers/null.py
===================================================================
--- trunk/docutils/docutils/writers/null.py	2024-06-14 16:19:49 UTC (rev 9765)
+++ trunk/docutils/docutils/writers/null.py	2024-06-14 16:19:59 UTC (rev 9766)
@@ -5,7 +5,7 @@
 """
 A do-nothing Writer.
 
-`self.output` will change from ``None`` to the empty string
+`self.output` changed from ``None`` to the empty string
 in Docutils 0.22.
 """
 
@@ -21,5 +21,4 @@
     config_section_dependencies = ('writers',)
 
     def translate(self):
-        # output = None   # TODO in 0.22
-        pass
+        self.output = ''

Modified: trunk/docutils/test/test_writers/test_null.py
===================================================================
--- trunk/docutils/test/test_writers/test_null.py	2024-06-14 16:19:49 UTC (rev 9765)
+++ trunk/docutils/test/test_writers/test_null.py	2024-06-14 16:19:59 UTC (rev 9766)
@@ -45,7 +45,7 @@
 ["""\
 This is a paragraph.
 """,
-None]
+'']
 ]
 
 if __name__ == '__main__':

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



_______________________________________________
Docutils-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-checkins
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.