mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1268 from bandb42/multiple_authors_fix
Split multiple authors on ',' instead of every character
This commit is contained in:
commit
16b288222d
3 changed files with 8 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ METADATA_PROCESSORS = {
|
|||
'status': lambda x, y: x.strip(),
|
||||
'category': Category,
|
||||
'author': Author,
|
||||
'authors': lambda x, y: [Author(author, y) for author in x],
|
||||
'authors': lambda x, y: [Author(author.strip(), y) for author in x.split(',')],
|
||||
}
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
|||
6
pelican/tests/content/article_with_multiple_authors.html
Normal file
6
pelican/tests/content/article_with_multiple_authors.html
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>This is an article with multiple authors!</title>
|
||||
<meta name="authors" content="First Author, Second Author" />
|
||||
</head>
|
||||
</html>
|
||||
|
|
@ -361,7 +361,7 @@ class HTMLReaderTest(ReaderTest):
|
|||
self.assertEqual(value, page.metadata[key], key)
|
||||
|
||||
def test_article_with_multiple_authors(self):
|
||||
page = self.read_file(path='article_with_multiple_authors.rst')
|
||||
page = self.read_file(path='article_with_multiple_authors.html')
|
||||
expected = {
|
||||
'authors': ['First Author', 'Second Author']
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue