Italics aren't applied for second instance in field if "and" is present
dstillman opened this issue · comments
Weird one!
https://forums.zotero.org/discussion/comment/363829/#Comment_363829
Testing with chicago-author-date
Placing this in the Volume field of an empty item results in FooBar an Baz
in italics:
<i>Foo</i><i>Bar an Baz</i>
Title. Vol. Foo**Bar an Baz.
But if "and" is present in the second string, the second string isn't italicized:
<i>Foo</i><i>Bar and Baz</i>
Title. 2023. Vol. Foo<i>Bar and Baz</i>.
Reproducible with this fixture where the CSL style is simplified.
I also test the content in fields title
, edition
, and page
other than volume
and it seems this bug only happens in number fields. I suspect it's related to citeproc-js parsing embedded locators in number fields (see test-suite/processor-tests/humans/number_OrdinalSpacing.txt).
BTW, since volume-title
is available now, perhaps we can solve the original problem with it?
Number fields are split here:
citeproc-js/src/util_number.js
Lines 327 to 362 in 73bc1b4
They're then appended to the output queue here:
citeproc-js/src/util_number.js
Line 999 in 73bc1b4
This then applies the formatting here:
Line 309 in 73bc1b4
Since the parts are still being processed separately the "stray" tags are "neutralized", here:
citeproc-js/src/util_flipflop.js
Lines 540 to 559 in 73bc1b4