Another rather finicky test question, I’m afraid.
bugreports_NumberInMacroWithVerticalAlign has the following input:
[
{
"edition": "2",
"id": "ITEM-1",
"title": "His Anonymous Life",
"type": "book"
},
{
"edition": "3-5",
"id": "ITEM-2",
"title": "His Anonymous Life",
"type": "book"
}
]
It has a nice simple csl. So far as is relevant:
<macro name="edition-mac">
<number variable="edition" font-style="italic"/>
</macro>
<citation>
<layout delimiter="; ">
<text macro="edition-mac" vertical-align="sup"/>
</layout>
</citation>
The expected result is:
<sup><i>2</i></sup>; <sup><i>3</i>–<i>5</i></sup>
I don’t quite understand this. I realise that because edition
is a number
field, and the entry here is numeric, it is correct for the processor to “sanitize” the hyphen, stripping off any spaces etc (though in fact there’s nothing to be done here). But citeproc-js
seems to assume that the formatting attribute set on number
should be applied only to the numbers, not to any hyphens etc (which is why it applies it only to the figures). If that’s what it means, I don’t think the specification says so: it simply says that
cs:number
may carry affixes, display, formatting and text-case attributes.
Of course a prefix
or suffix
would be outside the scope of the formatting attributes: but the hyphen here is not a prefix, or a suffix. It’s not even, strictly speaking, a delimiter (though as I read the spec delimiters should get formatting attributes: though I daresay I may find as I work through the tests that I’m wrong about that).
In this particular case, I highly doubt that it makes any difference, since nobody could tell the difference between 3-5 3-5 (though the spacing may well be “out” in the latter case). But if it were 3-5 vs 3-5 it would be noticeable, and to my mind the latter is questionable. It would be still odder if one imagined things the other way round, with the formatting as superscript, where 3-5 looks dowright odd, compared to 3-5.
Is citeproc-js’s behaviour here compulsory? Right?