Release Announcements¶Frank Bennett
- Fix bug in logging code introduced at 1.1.111
- Minutes after a Juris-M release incorporating the changes below, a colleague knocked on my door to say that word processor input had suddenly broken. We traced the cause to entries with an invalid language code (“Japanese” rather than “ja”), which should have logged a warning without throwing an error. The cause was a typo in the logging function itself (a missing argument in the signature). Now fixed, and things should work normally.
- Fix Homer-worthy nesting bug
- A research group (at Heidelberg University) had been getting persistent errors when attempting to generate multilingual bibliographies. The fault was traced to a clear coding error in the code used to output tertiary variants (i.e. the second of two variants to a cite field value). The fault has been fixed, and multilingual bibliographies in all configurations should now render without error.
- Use dump rather than throw if console not available
- Previously, the
CSL.error()function would throw a hard (crashing) error on systems that did not have a native
console.log()function with the expected characteristics (hello Windows). With this fix, the code falls back to the more primitive
dump()logging function, avoiding a crash. (Note that there was a bug in this fix, repaired at 1.1.113)
- Wrap section field remap in condition
- For legal item types in CSL-M styles, the
sectionfield is remapped to
locator, the allow storage of individual statutory sections as separate items in the database. This behaviour is not desired in standard CSL, but was not properly disabled. With the addition of a conditional, remapping is now properly disabled in vanilla CSL.
- Fix sorting behaviour
inconsistent results. This fix tests the effect of separator strings
hacked into processor-generated sort keys, choosing the separating
|) that will produce a correct sort. Tests prepared in response to the relevant bug report (from a user with Danish requirements) now pass, and existing sort tests also clear.
indexOf()as a native method on
Array(), so this workaround is no longer necessary.
- Show institution name variants even when abbrev is used
- Previously, when the short form of an institution name was used, its variants were not displayed, even in the first reference. With this change, variants are displayed. Some further tuning may be in order here, since institution names have differing roles for courts and for “proper” institutional authors, but we will pick up those use cases as they emerge over time.
- Previously, in multi-layout styles, the default-locale form of dates
as always used for the
accesseddate variable, and the localized form was used on all other date variables. The use of default locale can now be controlled in the same way as for
- Avoid array comprehensions
- In multi-layout styles, there was no way to force use of the
default-locale version of specific terms. With
cs:textthis is now possible.
- Extend use of en-dash on locator labels
- An en-dash was used for hyphen only on a limited subset of labels. It is generally the right thing to do, so its use has been extended.
Split Institution field
locator-extravariables that depend on content parsed out of the
locatorfield were not updating correctly in dynamic environments. This has been fixed.
- Fix bugs in new
year-suffixcode from 1.1.100
- The fix at 1.1.100 introduced fresh bugs in year-suffix disambiguation. These have been squashed.
- Title-case capitalization following forward slash
text-case="title"in an English locale, capitalize a word that follows a forward slash.
subtags when capitalizing
- Properly escape <sup></sup> and <sub></sub> markup when applying text transforms (fixes a bug unmasked by the change above).
- Use title as fallback for
- When no authors are available for
citation-label, use a fragment of the title.
- Strip font style and weight in multilingual variants
- When adding multilingual variants in output, suppress italics, oblique, and boldface in supplementary (secondary and tertiary) text.
citationIDin return from
This is a technical change, with no impact at user level.
While building a small demo of dynamic citation editing is a Web-based WYSIWYG editor, I found that including the value of
citationIDin the return from the
processCitationCluster()function greatly simplified page updates following a citation edit, so I added that value to the return.
- Delimiter bug with
- Certain delimiters were being dropped when rendering an explicit
year-suffixelement (a numeric value rendered as a string). This has been fixed.
In a bug related to the one above, and apparently triggered by changes in
1.1.100, an implicit
year-suffixwas rendering on dates with empty variables.
This has been fixed.
- Non-breaking-space joins following initials
Retain zero-width non-breaking space (
\uFEFF) and non-breaking space (
\u00A0) as the inter-initials join when these are the last character in the
In the RU (Russian), CS (Czech) and FR (French) locales only, when either of the non-breaking space elements is present in the attribute value, use non-breaking space (
\u00A0) as the given-to-family join when building initialized names in non-sort order. Otherwise, use an ordinary space for the given-to-family join.
Resolves the issue discussed at:
NB: This behaviour was added for the CS locale at later tag
- Date styling bug
- The affixes of a
cs:datenode with no variable content could affect the styling of subsequent date nodes. This has been fixed.
- Bug in
year-suffixform of disambiguation was misbehaving when used with
collapse="year-suffix". This has been fixed.
- Fix pluralism of embedded labels
- Shortcode labels that differ from the “main” label on a number (as in “p. 123 n. 1 & 2”) were not pluralizing properly. This has been fixed.
- To allow small extensions to the schema of calling applications
(generally not needed in Juris-M, but useful elsewhere), CSL
variables can be set in the
notefield of the CSL JSON input to the processor. The parsing code for doing so is now exposed, so that calling applications (including Juris-M) can make use of it where necessary for their own purposes.
- Fix bugs in parsing of names from note field hack syntax
- When parsing hack syntax out of the note field, single-field names
were being returned as two-field names with a value in the
familyfield only. This has been fixed.
- Pre-title macros in style modules
- Cites to cases decided by the European Court of Justice require the docket number before the case name. Style modules were not capable of generating this cite form, so an additional standard macro was added to the modules for that purpose.
- Bibliography entries as strings
- Locators with leading space
- A Zotero user reported that entering a leading space in the locator field in the word processor caused an unwanted page label (“p.”) to magically appear in some styles. This has been fixed.
- Handle styles with DOS and Mac line endings
- A Zotero user reported that the latest processor version was crashing
hard when styles had DOS or Mac line endings—”normal” line endings
line-feedonly, DOS line endings are
carriage-return+line-feed, and Mac line endings are
carriage-returnonly. This bug did not affect the distributed Juris-M styles, but it has been fixed, so if you use a non-Unix editor (such as Windows Notepad) to modify a style for some reason, it will continue to work.
- Handle styles with signle-quoted XML attribute values
- In a bug arising from the same set of changes that yielded the line-endings issue, styles (and locales) that used single-quotes on XML attribute values were also crashing the processor. Single-quotes are perfectly valid XML, and this bug has been squashed.
There are many changes to the infrastructure behind this release, and few changes to functionality apart from bug fixes. This back-room work will allow quicker releases, and lays a solid foundation for the development of legal style modules.
Here are the main items:
- Processor code on GitHub
- Most citation-related programming activity takes place on GitHub, and I finally bit the bullet and moved the citeproc-js code there, for easier deployment and smoother collaboration with developers.
- Style and locale parsing
- Validated test fixtures
- The test suite that backs up processor development hadn’t received much attention in recent years (apart from the addition of many test fixtures). The long-dormant facility for validating the CSL style objects used for testing has been resurrected, and all test CSL now passes validation. This brings greater assurance that what we see in the test framework will replicate in the field.
- Locators in legal style modules
- Modular style code is challenging for locator formatting, in particular, because these are heavily dependent on context, and the context is supplied by the calling style. With revisions to CSL-M, the extended version of CSL used in Juris-M styles, locators can be positioned using “smart conditions” that read the essential features of surrounding context. As a result the burden on legal style development has lightened considerably, and we are now ready to scale the system out to cover additional jurisdictions.
- The processor compares the shortest form of citations for ambiguity before adding information to citations. Legal styles that implement a “five-footnote rule” must test the near form of cites for this to work. That wasn’t happening, but it is now.
- Straight-quotes hanging bug
- When straight quotes were set as the preferred quotation marks in a new CSL locale, it triggered a hanging bug in the processor. This has been fixed.
- Nesting mismatch errors
- The processor builds citations as deeply nested string sets, with the siblings joined by a delimiter at each level to produce printed output. For performance reasons the nesting is “spoofed” by markers in a list executed from start to finish, and if the markers are incorrectly place, weird things can happen (in theory). The markers were very slightly incorrect in two instances that manifested in Zotero/Juris-M, but not in the pre-release test suite. The bugs have been fixed, and the test suite has been fixed to pick these errors up if they every occur again.
- Arabic locale
- The Arabic locale was not loading. At all. Ever. This has been fixed.
- Charset sniffing
- The regular expression used to guess whether the character set of some strings is “romanesque” included some dingbat-type characters. These have been removed.
- Safe syntax for global replacements
- Safer sorting
- Remove lurking list comprehensions