summaryrefslogtreecommitdiff
path: root/docutils
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2023-04-17 20:26:33 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2023-04-17 20:26:33 +0000
commit0cdd4d3ddd996f44bfb0f7d12ef5c3baac925721 (patch)
treedd3e1f48043e53e64fab2f5548feedaffcb41a6a /docutils
parentbe7394ef9067f3fa677529201e277cb784716d7e (diff)
downloaddocutils-0cdd4d3ddd996f44bfb0f7d12ef5c3baac925721.tar.gz
Fix test failure introduced in [r9348].
Reword and wrap warning message for incompatible content of the bibliographic field "author". Adapt "frontmatter" unit test cases. git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@9351 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils')
-rw-r--r--docutils/transforms/frontmatter.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/docutils/transforms/frontmatter.py b/docutils/transforms/frontmatter.py
index 08fcea387..eea11ea3f 100644
--- a/docutils/transforms/frontmatter.py
+++ b/docutils/transforms/frontmatter.py
@@ -513,14 +513,15 @@ class DocInfo(Transform):
raise TransformError
except TransformError:
field[-1] += self.document.reporter.warning(
- 'Bibliographic field "%s" incompatible with extraction: '
- '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. Remember that leading initials can cause '
- '(mis)recognizing names as enumerated lists.'
- % (name, ''.join(self.language.author_separators)),
- base_node=field)
+ f'Cannot extract "{name}" from bibliographic field:\n'
+ f'Bibliographic field "{name}" must contain either\n'
+ ' a single paragraph (with author names separated by one of '
+ f'"{"".join(self.language.author_separators)}"),\n'
+ ' multiple paragraphs (one per author),\n'
+ ' or a bullet list with one author name per item.\n'
+ 'Note: Leading initials can cause (mis)recognizing names '
+ 'as enumerated list.',
+ base_node=field)
raise
def authors_from_one_paragraph(self, field):