typst / hayagriva

Rusty bibliography management.
Apache License 2.0
347 stars 54 forks source link

Issue with CSL Rendering (OSCOLA no ibid Style) #109

Open daniel-eder opened 11 months ago

daniel-eder commented 11 months ago

Description

OSCOLA style should have a comma between the edition and the publisher.

A valid rendering from https://editor.citationstyles.org/visualEditor/ (using this csl json to get the citation example): image

Compared to the rendering in typst.app: image

Notice the missing comma.

The CSL style is https://github.com/citation-style-language/styles/blob/master/oscola-no-ibid.csl

Reproduction URL

https://typst.app/project/rY0Nmyq6PphmJZy877_lLT

Operating system

Web app, Windows

Typst version

daniel-eder commented 11 months ago

Might be related to https://github.com/typst/hayagriva/issues/107

DerDrodt commented 11 months ago

I found the error: The rendering of group containing choose is wrong:

In hayagriva, a Choose element has a delimiter. This is wrong; according to the specification, this is not a valid attribute on choose.

The rendering done in https://github.com/DerDrodt/hayagriva/blob/219a4cf76ee54247ec2deca4a80661da4f15f003/src/csl/rendering/mod.rs#L644-L656 is therefore wrong.

Instead of the rendering of Choose rendering its children, it should "return" a list of children, which are then properly formatted by Group.

Fixing this will take time, and I am not too familiar with the rendering. Someone else should probably fix this.