diff --git a/bibtexbrowser-test.php b/bibtexbrowser-test.php index ce9e8d6..85a157d 100755 --- a/bibtexbrowser-test.php +++ b/bibtexbrowser-test.php @@ -405,6 +405,9 @@ class BTBTest extends PHPUnit_Framework_TestCase { $this->assertEquals("à Book",$dis->getTitle()); $this->assertEquals("Jé Lo",$dis->getFormattedAuthorsString()); + // ensure that it is comma separated, used for metadata + $this->assertEquals("Lo, Jé",$dis->getArrayOfCommaSeparatedAuthors()[0]); + bibtexbrowser_configure('BIBTEXBROWSER_USE_LATEX2HTML', false); $test_data = fopen('php://memory','x+'); fwrite($test_data, $bibtex); diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 663070a..bd54255 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -1582,10 +1582,13 @@ class BibEntry { return $authors; } - /** Returns the authors of this entry as an array in a comma-separated form */ + /** Returns the authors of this entry as an array in a comma-separated form + * Mostly used to create meta tags (eg + */ function getArrayOfCommaSeparatedAuthors() { $authors = array(); foreach ($this->getRawAuthors() as $author) { + $author = $this->transformValue($author); $authors[]=$this->formatAuthorCommaSeparated($author); } return $authors;