|
From: <mi...@us...> - 2023-04-14 00:12:09
|
Revision: 9348
http://sourceforge.net/p/docutils/code/9348
Author: milde
Date: 2023-04-14 00:12:07 +0000 (Fri, 14 Apr 2023)
Log Message:
-----------
Fix test for spurious enumerated lists in bibliographic fields.
The test for "single line paragraphs" failed for bibliographic fields followed
by an empty line.
Modified Paths:
--------------
trunk/docutils/docutils/transforms/frontmatter.py
trunk/docutils/test/test_transforms/test_docinfo.py
Modified: trunk/docutils/docutils/transforms/frontmatter.py
===================================================================
--- trunk/docutils/docutils/transforms/frontmatter.py 2023-04-14 00:11:56 UTC (rev 9347)
+++ trunk/docutils/docutils/transforms/frontmatter.py 2023-04-14 00:12:07 UTC (rev 9348)
@@ -466,7 +466,7 @@
# enumerated list
# https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#enumerated-lists
if (isinstance(f_body[0], nodes.enumerated_list)
- and '\n' not in f_body.rawsource):
+ and '\n' not in f_body.rawsource.strip()):
# parse into a dummy document and use created nodes
_document = utils.new_document('*DocInfo transform*',
field.document.settings)
@@ -517,7 +517,8 @@
'it must contain either a single paragraph (with authors '
'separated by one of "%s"), multiple paragraphs (one per '
'author), or a bullet list with one paragraph (one author) '
- 'per item.'
+ 'per item. Remember that leading initials can cause '
+ '(mis)recognizing names as enumerated lists.'
% (name, ''.join(self.language.author_separators)),
base_node=field)
raise
Modified: trunk/docutils/test/test_transforms/test_docinfo.py
===================================================================
--- trunk/docutils/test/test_transforms/test_docinfo.py 2023-04-14 00:11:56 UTC (rev 9347)
+++ trunk/docutils/test/test_transforms/test_docinfo.py 2023-04-14 00:12:07 UTC (rev 9348)
@@ -75,8 +75,11 @@
It is automatically moved to the end of the other bibliographic elements.
:Author: E. *Xample*
+
:Version: 1
+
:Date: 2001-08-11
+
:Parameter i: integer
""",
"""\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|