[citeproc bug] substitute doesn't inherit label with conditional
Minimal example here:
https://gist.github.com/adam3smith/618f8c1c5afab7c22647
Output:
Bob Hancke et al.
Expected:
Bob Hancke et al., eds.
Explanation: <names variables don't inhert characteristics in substitute if they're inside a conditional (choose) element.
Let me know if you need any more info (or if there's a reason for this I'm overlooking).
https://gist.github.com/adam3smith/618f8c1c5afab7c22647
Output:
Bob Hancke et al.
Expected:
Bob Hancke et al., eds.
Explanation: <names variables don't inhert characteristics in substitute if they're inside a conditional (choose) element.
Let me know if you need any more info (or if there's a reason for this I'm overlooking).
The label has been dropping in that construction because cs:substitute is not an immediate parent of cs:names. The fix looks for a cs:substitute ancestor, and retains the label when it is found.
Note that moving the bare cs:names element into a macro, and calling the macro from within cs:substitute will continue to strip the label, since it would no longer be bound to that context.
I'll post again when the fix has been cleaned up and is ready for testing.
[1] Citeproc-js still relies on Rhino + E4X in the test suite, and a trawl turned up nothing easy for adding DOM to standalone V8 or SpiderMonkey. I'll eventually set up to test the JSON module, which is probably the parser of choice now, given the speed advantages. DOM will have to go on the back burner.)
(seems to be holding back https://github.com/citation-style-language/styles/pull/1878#issuecomment-193296610)