[citeproc bug] substitute doesn't inherit label with conditional

Minimal example here:

Bob Hancke et al.
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).
  • edited February 27, 2016
    Confirmed. I have a fix, but I will be unable to test on all platforms, [1] so I'll code it for the three DOM parsing modules, and we'll see how it goes.

    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.)
  • edited October 7, 2016
    @fbennett, did the fix make it into citeproc-js yet?

    (seems to be holding back https://github.com/citation-style-language/styles/pull/1878#issuecomment-193296610)
  • yes it did. Closed the CSL issue. Thanks Frank.
Sign In or Register to comment.