Skip to content

Commit

Permalink
pkp#6331 Delimit single citations with a line break before importing
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Nov 13, 2020
1 parent ab63042 commit 73b5d27
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -245,7 +245,13 @@ function parseAuthor($n, $publication) {
*/
function parseCitations($n, $publication) {
$publicationId = $publication->getId();
$citationsString = $n->textContent;
$citationsString = '';
foreach ($n->childNodes as $citNode) {
$nodeText = trim($citNode->textContent);
if (empty($nodeText)) continue;
$citationsString .= $nodeText ."\n";
}
$publication->setData('citationsRaw', $citationsString);
$citationDao = DAORegistry::getDAO('CitationDAO'); /** @var $citationDao CitationDAO */
$citationDao->importCitations($publicationId, $citationsString);
}
Expand Down

0 comments on commit 73b5d27

Please sign in to comment.