Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

group/label, test chain seems confused on display or not display the <group> #158

Open
3 tasks done
glorieux-f opened this issue Aug 1, 2023 · 0 comments
Open
3 tasks done

Comments

@glorieux-f
Copy link
Contributor

glorieux-f commented Aug 1, 2023

  • I read the README and followed the instructions.
  • I am sure that the used CSL metadata follows the CSL schema.
  • I use a valid CSL stylesheet

Bug reports:

citeproc-php

  • Doe, J. (s. d.). Bug no number-of-volumes.
  • Doe, J. (s. d.). Bug “1‑” (1‑).

zotero desktop client

  • Doe, J. (s. d.-a). Bug “1‑”.
  • Doe, J. (s. d.-b). Bug no number-of-volumes (1‑3).

Used CSL stylesheet:

apa.csl#L1077

    <else>
      <group>
        <label variable="number-of-volumes" form="short" text-case="capitalize-first" suffix=" "/>
        <text term="page-range-delimiter" prefix="1"/>
        <number variable="number-of-volumes" form="numeric"/>
      </group>
    </else>

Commenting <label variable="number-of-volumes" form="short" text-case="capitalize-first" suffix=" "/> is a quick-and-dirty fix, but there are other configurations of groups containing <label> in apa.csl.

A better fix seems around line Rendering/Group.php#L104, <label> is counted as a reason to display the group, only if a content is generated for the label (here, when number-of volumes is not empty).

        $text = $child->render($data, $citationNumber);
        // …
        if (($child instanceof Label) && !empty($text)) {
            ++$terms;
        }

Used CSL metadata

[
    {
        "id": "n1",
        "type": "book",
        "title": "Bug “1‑”",
        "author": [
            {
                "family": "Doe",
                "given": "John"
            }
        ]
    },
    {
        "id": "n2",
        "type": "book",
        "number-of-volumes": "3",
        "title": "Bug no number-of-volumes",
        "author": [
            {
                "family": "Doe",
                "given": "John"
            }
        ]
    },
{
	"id": "n3",
	"type": "book",
	"title": "Keep “trans.” label",
	"author": [
		{
			"family": "Doe",
			"given": "John"
		}
	],
	"translator": [
		{
			"family": "Translator",
			"given": "Allan"
		}
	]
}
]
@glorieux-f glorieux-f changed the title apa.csl, an auto “1‑” parasite and number-of-volumes is not displayed apa.csl, a bug on <label> ? Aug 1, 2023
@glorieux-f glorieux-f changed the title apa.csl, a bug on <label> ? Bug on group/label test for display ? Aug 1, 2023
@glorieux-f glorieux-f changed the title Bug on group/label test for display ? group/label, test chain seems confused on display or not display Aug 2, 2023
@glorieux-f glorieux-f changed the title group/label, test chain seems confused on display or not display group/label, test chain seems confused on display or not display the <group> Aug 2, 2023
glorieux-f added a commit to glorieux-f/citeproc-php that referenced this issue Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant