Support semicolon-separated author/tag lists.

Idea borrowed from Docutils.  This allows one to write author lists in
lastname,firstname format.  The code change also means that readers with
fancy metadata that can natively represent lists (e.g. Docutils itself,
or MD-Yaml) don't have to merge 'em back together for process_metadata's
sake.
This commit is contained in:
Zack Weinberg 2015-03-21 21:54:06 -04:00
commit c918380802
6 changed files with 67 additions and 9 deletions

View file

@ -324,6 +324,23 @@ class RstReaderTest(ReaderTest):
self.assertDictHasSubset(page.metadata, expected)
def test_article_with_multiple_authors_semicolon(self):
page = self.read_file(
path='article_with_multiple_authors_semicolon.rst')
expected = {
'authors': ['Author, First', 'Author, Second']
}
self.assertDictHasSubset(page.metadata, expected)
def test_article_with_multiple_authors_list(self):
page = self.read_file(path='article_with_multiple_authors_list.rst')
expected = {
'authors': ['Author, First', 'Author, Second']
}
self.assertDictHasSubset(page.metadata, expected)
@unittest.skipUnless(readers.Markdown, "markdown isn't installed")
class MdReaderTest(ReaderTest):