seboettg / citeproc-php

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

Missing space between authors and chapter #95

Closed westcomputerconsultancy closed 3 years ago

westcomputerconsultancy commented 3 years ago

In a citation of a chapter the space is missing between the authors and the chapter

so, for example, instead of Bloom, Harold. “Twelfth Night.” Shakespeare: The Invention of the Human. London: Forth Estate, 1998. 226–246. Print.

I am getting

Bloom, Harold.“Twelfth Night.” Shakespeare: The Invention of the Human. London: Forth Estate, 1998. 226–246. Print.

I think I might have tracked the problem down to

src/Styles/AffixesTrait.php

lines 86-89

            if ($closeQuote === $lastChar) { // last char is closing quote?
                $text = mb_substr($text, 0, mb_strlen($text) - 1); //set suffix before
                return $text . $suffix . $lastChar;
            }

I think should be

            if ($closeQuote === $lastChar) { // last char is closing quote?
                $text = mb_substr($text, 0, mb_strlen($text) - 1); //set suffix before
                return $prefix . $text . $suffix . $lastChar;
            }

but I'm not confident enough that I understand how the code works to be certain.

Used CSL stylesheet:

modern-language-association-7th-edition.csl

Used CSL metadata

Please replace these lines with your used metadata, for instance: [ { "number-of-volumes": "", "issued": { "date-parts": [ [ "1998", "07", "02" ] ] }, "publisher": "Forth Estate", "publisher-place": "London", "type": "chapter", "container-title": "Shakespeare: The Invention of the Human", "author": [ { "given": "Harold", "family": "Bloom" } ], "page": "226-246", "title": "Twelfth Night" } ]

seboettg commented 3 years ago

Hi @westcomputerconsultancy! Bugfix for this in v.2.2.4 Please update citeproc-php and close this issue if the bug is solved. Thank you.

westcomputerconsultancy commented 3 years ago

Fixed. Many thanks.