Extra Space after Opening Bracket or Parenthesis in SBL Style
Greetings, all.
I'm using the most current version of the SBL style (5/3/14) in the most current version of Zotero (4.0.22) in Word 2007 and Word 2013 (on two different Windows 7 machines). Yesterday, I noticed that the style is now adding a space after an opening parenthesis or opening square bracket when that character is added in a citation's prefix field. In SBL style, citations are often enclosed in parentheses or square brackets when they are included in content footnotes.
So, for instance, if I want to get the output:
P.S.: Would this adjustment have anything to do with the situation I'm describing above?: https://forums.zotero.org/discussion/37875/citeprocjs-should-add-a-whitespace-after-a-prefixbefore-a-suffix-in-more-cases/
I'm using the most current version of the SBL style (5/3/14) in the most current version of Zotero (4.0.22) in Word 2007 and Word 2013 (on two different Windows 7 machines). Yesterday, I noticed that the style is now adding a space after an opening parenthesis or opening square bracket when that character is added in a citation's prefix field. In SBL style, citations are often enclosed in parentheses or square brackets when they are included in content footnotes.
So, for instance, if I want to get the output:
or:(Roberts, Donaldson, and Coxe, Ante-Nicene Fathers, 2:427)
I would typically add "(" or "[" in the prefix field when creating the citation. I've double checked that I have done so and haven't accidentally inserted an additional space after this character. Despite this fact, however, prefixes ending in opening parentheses or opening square brackets now seem to result in the following output:[Roberts, Donaldson, and Coxe, Ante-Nicene Fathers, 2:427]
or:. . . ( Roberts, Donaldson, and Coxe, Ante-Nicene Fathers, 2:427)
Any suggestions or solutions you might have would be most helpful!. . . [ Roberts, Donaldson, and Coxe, Ante-Nicene Fathers, 2:427]
P.S.: Would this adjustment have anything to do with the situation I'm describing above?: https://forums.zotero.org/discussion/37875/citeprocjs-should-add-a-whitespace-after-a-prefixbefore-a-suffix-in-more-cases/
I'm thinking " ' (as well as their smart opening versions) ( [ and, probably for completeness, ¿¡
Anything else?
Thank you so much!
For testing, we start by stripping the prefix string of CSL markup (<i></i> etc.), straight single- and double-quotes, right-side single- and double-quotes, and trailing space.
We should then have been adding a space when the test string: (1) ends in a roman-or-similar character; or (2) ends in a terminal character—otherwise there should be no space. Terminal characters are currently set to be: :, ., ;, !, and ?.
Thanks to the coding mistake, the test at (1) was working correctly, but the test at (2) was applying a space unless the prefix string ended in colon. Which was, um, totally wrong.
If the test above is fixed, opening parens and brackets work correctly (they don't attract a space because they are not roman-ish characters, and are not in the terminal-punctuation list). However, closing parens and brackets also don't get a space. I'm thinking those should be added to the list.
That should get these characters working correctly as well: Closing brackets and parens test okay. Inverted exclamation and question marks would be unusual as an opening for a citation, but they will attract no space. The various forms of single- and double-quotes are just ignored, and we look at the character behind them instead.
If I fix the code and add closing parens and brackets to the test, I think we should be good, but let me know if you spot any problems with that. When I get a revision bundled up, I'll post back with a link to the patch plugin for testing.
EDIT: The comma should also be in that list, and the automagic capitalization of terms should happen only following characters in the existing list; comma and closing parens or brackets should not trigger term capitalization.
EDIT2: Should also strip ordinary and thin non-breaking spaces and right-side guillmet, and treat numeric characters on the same basis as alphabetic (i.e. attracting a space, but not forcing term capitalization).
EDIT: As adamsmith notes below, the plugin works with Zotero for Firefox only.