seboettg / citeproc-php

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

Vancouver Citation Style format : spaces between date parts ? #94

Closed mhvezina closed 3 years ago

mhvezina commented 3 years ago

It seems the Vancouver citation style format would benefit from spaces between date parts if I'm not wrong (?). This has been observed in OJS and reported here : https://forum.pkp.sfu.ca/t/vancouver-citation-style-format-extra-spaces-between-date-parts/62754

Subsequent testing by @asmecher of a citation using citeproc-php directly produced indeed the same problem with the dates (see reply on the same post).

Thank you,

Marie-Hélène V.

seboettg commented 3 years ago

Hi @mhvezina, @asmecher! Thank you for this bug report. If I understand the issue, then a space delimiter is missing between the "DateParts".

There are countless styles and possibilities how CSL rules can be interpreted. Please understand that I need the CSL input data (JSON) and the exact style name as well as the expected result and the actual result in order to reproduce the issue.

With this information I have also the opportunity to compare the results with other processors and am able to estimate if this is a bug in citeproc-php and/or in the used stylesheet.

Please complete the missing information.

asmecher commented 3 years ago

Hi @seboettg! To reproduce the problem...

  1. Set up a citeproc-php checkout

    git clone git://github.com/seboettg/citeproc-php
    cd citeproc-php
    composer install
    composer test

    Result: All tests work.

  2. Create a test script test.php that uses the Vancouver citation style brought in by the composer install command:

    
    <?php
    require('vendor/autoload.php');

use Seboettg\CiteProc\StyleSheet; use Seboettg\CiteProc\CiteProc;

$style = StyleSheet::loadStyleSheet('vancouver'); $citeProc = new CiteProc($style); echo $citeProc->render([ (object) [ 'type' => 'article-journal', 'title' => 'The Signalling Theory Dividends: A Review Of The Literature And Empirical Evidence', 'issued' => (object) ['raw' => '2020-10-29'], ] ], 'bibliography');

3. Run the test script:

$ php test.php

1.
The Signalling Theory Dividends: A Review Of The Literature And Empirical Evidence. 2020Oct.29;.

In the resulting output, the date is run together without separators: `2020Oct.29`
seboettg commented 3 years ago

solved with v2.2.5

asmecher commented 3 years ago

Thanks, @seboettg and @mhvezina!