WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Bibliography CSL "substitute" element does not always work as expected #2283

@Omikhleia

Description

@Omikhleia

When a <csl:substitute> element is processed, "substituted variables are suppressed in the rest of the output to prevent duplication"

Well, our logic here is somewhat broken :(

Sometimes they are duplicated, sometimes there's too much suppression. It highly depends on the CSL style (i.e. how it has nesting, groups, choose conditions etc.), so an MWE is hard to extract.

I probably introduced a regression via commit e805a2c (so since 0.15.10) which affects some of my workflows (= duplicated items, due to wrapping macros in a pseudo-groups) with my own styles.

But the logic was likely already broken from the origin... Currently, we might even suppress a variable at sorting, and we then don't have it any longer at rendering... Oops. It's not very clear how to behave here. But even cancelling suppression at sorting, some problem remain afterwards.
I also experimented a quick hack with my main (custom MLA-based) style, but it's probably not a generic fix, and I'm afraid we'd have to track substitutions better than we currently do, the initial stuff was naive there...

So I am just reporting the issue for now, at least, with no idea yet how to fix it properly.
One of the problems is that we don't have tests yet for this CSL light implementation to check both for correctness and regression, but crafting them would be hard (and the CSL tests in their repository are fairly messy too to start with....).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSoftware bug issueneeds MWEMinimum working example needed for investigationpackages:bibliography

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions