Add formatting attribute to support more bibliography styles - #344
Open
pluto-han wants to merge 1 commit into
Open
Add formatting attribute to support more bibliography styles#344pluto-han wants to merge 1 commit into
pluto-han wants to merge 1 commit into
Conversation
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @michel-kraemer, I am a GSoC student in @JabRef working on my project Improved LibreOffice-JabRef integration.
Thank you very much for your work!
Follow up #338
Refs JabRef/jabref#16555 (comment)
Issue
Formatting attributes on
cs:dateandcs:date-partelements are currently not preserved in rendered output.For example, Advanced Functional Materials marks a date as bold:
But citeproc-java produces the following HTML output:
Rendered output:

[1] M. Macht, J. Mueller, Appetite 2007, 49, 667.
As seen in JabRef -
Expected:

[1] M. Macht, J. Mueller, Appetite 2007, 49, 667.
As seen in Zotero -
(The following part was generated by gpt 5.5 and reviewed & edited by me)
Cause/Analysis
SDateandSDatePartparse affixes and other date-specific behavior, but they do not read or applyFormattingAttributes.This means formatting attributes such as
font-weight,font-style,vertical-align, etc. are ignored when they are placed directly oncs:dateorcs:date-part.Fix
This change adds
FormattingAttributessupport to both date rendering classes:SDatenow reads formatting attributes from thecs:datenode and emits the rendered date content with those attributes.SDatePartnow reads formatting attributes from thecs:date-partnode and emits the rendered date part value with those attributes.Affix handling remains unchanged, so this does not widen the special
cs:layoutaffix behavior fixed in #338 to other rendering elements.Tests
Added a regression test covering both cases:
cs:datecs:date-partThe test verifies that HTML output preserves the expected formatting, e.g.:
I ran:
JAVA_HOME=$(/usr/libexec/java_home -v 17) ./gradlew :citeproc-java:testand all tests pass.