Closed cambraca closed 2 years ago
The rendered bibliography item for the CSL metadata below is:
braintree/Braintree_php. Braintree; 2021. Accessed June 21, 2021. https://github.com/braintree/braintree_php/blob/d6ce80f7f54abe9972d577173343d1975bc49e77/lib/Braintree/Digest.php
The title should be "Braintree/Braintree_php", starting with an upper case "B", as per this section of the CSL:
<macro name="title"> <choose> <if type="bill book graphic legal_case legislation motion_picture report song" match="any"> <text variable="title" font-style="italic" text-case="title"/> </if> <else> <text variable="title"/> </else> </choose> </macro>
I traced it to the StringHelper::capitalizeForTitle function, and tested it directly:
StringHelper::capitalizeForTitle('foo bar') === 'Foo Bar' // correct StringHelper::capitalizeForTitle('foo/bar') === 'foo/Bar' // incorrect
american-medical-association.csl
[ { "id": "item-1", "type": "book", "abstract": "Braintree PHP library", "genre": "PHP", "note": "original-date: 2010-02-26T00:46:58Z", "publisher": "Braintree", "source": "GitHub", "title": "braintree\/braintree_php", "URL": "https:\/\/github.com\/braintree\/braintree_php\/blob\/d6ce80f7f54abe9972d577173343d1975bc49e77\/lib\/Braintree\/Digest.php", "accessed": { "date-parts": [ [ "2021", 6, 21 ] ] }, "issued": { "date-parts": [ [ "2021", 6, 21 ] ] } } ]
Bug report:
The rendered bibliography item for the CSL metadata below is:
The title should be "Braintree/Braintree_php", starting with an upper case "B", as per this section of the CSL:
I traced it to the StringHelper::capitalizeForTitle function, and tested it directly:
Used CSL stylesheet:
american-medical-association.csl
Used CSL metadata