Skip to content

Commit

Permalink
Merge pull request #134 from seboettg/release/2.5.0
Browse files Browse the repository at this point in the history
Release/2.5.0
  • Loading branch information
seboettg authored Aug 2, 2022
2 parents 209be3f + 6dfdc2c commit e0f8f49
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
![PHP](https://img.shields.io/badge/PHP-7.3-green.svg?style=flat)
![PHP](https://img.shields.io/badge/PHP-7.4-green.svg?style=flat)
![PHP](https://img.shields.io/badge/PHP-8.0-green.svg?style=flat)
![PHP](https://img.shields.io/badge/PHP-8.1-green.svg?style=flat)

citeproc-php is a full-featured CSL 1.0.1 processor that renders bibliographic metadata into html formatted citations or bibliographies using CSL stylesheets. citeproc-php renders bibliographies as well as citations (except of [Citation-specific Options](http://docs.citationstyles.org/en/stable/specification.html#citation-specific-options)).

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
},
"require": {
"seboettg/collection": ">=3.0",
"seboettg/collection": ">=v3.1.0",
"myclabs/php-enum": "^1.8",
"ext-simplexml": "*",
"ext-json": "*",
Expand Down
1 change: 1 addition & 0 deletions src/Rendering/Date/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function setDay($day)
* @param int $day
* @return $this
*/
#[\ReturnTypeWillChange]
public function setDate($year, $month, $day)
{
$this->year = $year;
Expand Down
4 changes: 2 additions & 2 deletions src/Style/InheritableNameAttributesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ public function initInheritableNameAttributes(SimpleXMLElement $node)
break;
case 'et-al-use-last':
if (!empty($attribute)) {
$this->etAlUseLast = boolval((string) $attribute);
$this->etAlUseLast = ((string) $attribute) === "true";
} elseif (!empty($parentStyleElement)) {
$this->etAlUseLast = $parentStyleElement->getEtAlUseLast();
}
break;
case 'initialize':
if (!empty($attribute)) {
$this->initialize = boolval((string) $attribute);
$this->initialize = ((string) $attribute) === "true";
} elseif (!empty($parentStyleElement)) {
$this->initialize = $parentStyleElement->getInitialize();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
>>===== MODE =====>>
bibliography
<<===== MODE =====<<

>>===== RESULT =====>>
<div class="csl-bib-body">
<div class="csl-entry">Helix, Felix. “How to Do Anything at All.”</div>
</div>
<<===== RESULT =====<<

>>===== CSL =====>>
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="minimal-two">
<info>
<title></title>
<id></id>
<updated>2018-01-09T14:13:59+00:00</updated>
</info>
<locale xml:lang="en">
<style-options punctuation-in-quote="true"/>
</locale>
<macro name="author">
<names variable="author">
<name name-as-sort-order="first" and="text" delimiter-precedes-last="always" delimiter-precedes-et-al="always" initialize="false" initialize-with=". "/>
<label form="long" prefix=", "/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="title">
<choose>
<if variable="container-title" match="any">
<text variable="title" quotes="true" text-case="title"/>
</if>
<else>
<text variable="title" font-style="italic" text-case="title"/>
</else>
</choose>
</macro>
<bibliography>
<layout suffix=".">
<group delimiter=". ">
<text macro="author"/>
<text macro="title"/>
</group>
</layout>
</bibliography>
</style>
<<===== CSL =====<<

>>===== INPUT =====>>
[
{
"author": [
{
"family": "Helix",
"given": "Felix"
}
],
"container-title": "motivational studies",
"container-title-short": "most",
"id": "ITEM-2",
"issue": "1",
"publisher-place": "Cologne, Germany",
"title": "How to do anything at all",
"type": "article-journal",
"volume": "1"
}
]
<<===== INPUT =====<<
5 changes: 5 additions & 0 deletions tests/src/BugfixTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,9 @@ public function testBugfixGithub117()
{
$this->runTestSuite('bugfix-github-117');
}

public function testBugfixGithub114()
{
$this->runTestSuite('bugfix-github-114');
}
}

0 comments on commit e0f8f49

Please sign in to comment.