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

Add possibility to include affixes in lambda functions, Issue #100, 2 #110

Merged
merged 5 commits into from
May 6, 2022

Conversation

nongenti
Copy link
Contributor

Hallo @seboettg,

it is not possible to create a pull request with "Allow edits by maintainers", if owner is an organization.
https://github.51.almunity/t/how-can-we-enable-allow-edits-from-maintainers-by-default/2847/6

My organization gave me permission to create a user-owned fork in this case.

I hope now all is right.

Regards,
Christian

@seboettg
Copy link
Owner

seboettg commented Sep 22, 2021

Hi @nongenti!
Now I'm able to add commits to your PR. Thank you for that and sorry for that hassle. But now it's much easier to discuss your suggested changes and to work on it in a more collaborative way.

I wrote a simple test case for the requirement of issue #100 and unfortunately your changes does not work as expected.
The setup of the test case is

$additionalMarkup = [
    "title" => [
        'function' => function ($cslItem, $renderedText) {
            return '<span class="cite-title">' . $renderedText . '</span>';
        },
        'affixes' => false
    ],
    "citation-number" => [
        'function' => function ($cslItem, $renderedText) {
            return '<span class="cite-no">' . $renderedText . '</span>';
        },
        'affixes' => true
    ]
];

Stylesheet: springer-lecture-notes-in-computer-science. You can find the used CSL data in my commit.
Anyhow, I would expect that the rendered result is like this:

  <div class="csl-entry"><div class="csl-left-margin"><span class="cite-no">1.</span></div><div class="csl-right-inline">Doe, J., III: <span class="cite-title">My Anonymous Heritage</span>. (2001).</div></div>

But the actual result is:

<div class="csl-entry"><div class="csl-left-margin"><span class="cite-no"><span class="cite-no">1</span>.</span></div><div class="csl-right-inline">Doe, J., III: <span class="cite-title">My Anonymous Heritage</span>. (2001).</div></div>\

The embracing span tag <span class="cite-no">, as defined in $additionalMarkup, appears two times nested in each other.

@seboettg
Copy link
Owner

seboettg commented Oct 3, 2021

Hi @nongenti, do you have any ideas to solve this?

@nongenti
Copy link
Contributor Author

nongenti commented Oct 4, 2021

Hi @seboettg, sorry I've to finish an other project this week. I will look at this next week.

@nongenti
Copy link
Contributor Author

Hi @seboettg,
the problem was in function renderCitationNumber. In my test cases I never used the citation number, so I don't see this error before. Now your test is running well.

Regards, Christian

@nongenti
Copy link
Contributor Author

Hi @seboettg,
is there any other problem with that?

@seboettg seboettg merged commit b63d68a into seboettg:master May 6, 2022
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

Successfully merging this pull request may close these issues.

3 participants