zotero / citeproc-js-server

Web service to generate citations and bibliographies using citeproc-js
Other
60 stars 39 forks source link

Add cs:name nodes only when necessary #27

Closed fbennett closed 8 years ago

fbennett commented 8 years ago

Bare cs:names nodes became legal in CSL after the citeproc-js name formatting code was complete. To process them without reworking existing code, I added an addMissingNameNodes() function to the input parsers, and called it from processor code.

The function definition in xmljson.js had a bug that made it over-aggressive. As a result, in some styles an extraneous minimal cs:name node was appended after an existing node, causing formatting attributes to be lost, triggering the bug discussed in #26.

This PR should clear the bug.

dstillman commented 8 years ago

That fixes it — thanks for the help with this!

fbennett commented 8 years ago

Glad to help, sorry that the bug was there to bite in the first place.