seboettg / citeproc-php

Full-featured CSL 1.0.1 processor for PHP
MIT License
73 stars 38 forks source link

Comma character in title field breaks output when quotes=true #106

Closed cambraca closed 2 years ago

cambraca commented 3 years ago

Bug report:

Rendered bibliography doesn't contain the full title when there's a comma in between.

The QuotesTrait::addSurroundingQuotes() method seems to be the culprit.

Expected:

<div class="csl-bib-body">
  <div class="csl-entry">“Article Title, With a Comma”. <i>My Publisher</i>.</div>
</div>

Actual:

<div class="csl-bib-body">
  <div class="csl-entry">“ With a Comma”. <i>My Publisher</i>.</div>
</div>

Used CSL stylesheet:

modern-language-association.csl

Used CSL metadata

Please replace these lines with your used metadata, for instance:

[
    {
        "id": "ITEM-1",
        "type": "webpage",
        "container-title": "My publisher",
        "title": "Article title, with a comma."
    }
]
mgip commented 3 years ago

is anyone make work with the API of mendeley?