Repository navigation
Conversation
citeproc-php moves a title's "." suffix inside the closing quote without checking for terminal punctuation, so Chicago (both styles) and MLA rendered "What Is It?.”". Strip a period that follows "?" or "!" (with or without a closing quote) in the formatter's text normalization. Commas are kept, as CMOS allows after a question-mark title. citeproc-js already renders these titles correctly; the server output now matches it. Existing style goldens are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The server formatter (citeproc-php, behind
bibliography_builder_format_csl_items()andbibliography_builder_write_prepare_entries()) puts a period inside the closing quote after a title that already ends in?or!:“What Are Reduced Penetrance and Variable Expressivity?.” MedlinePlus. …Moss, Ann. “Diabetes Technology: What’s New in 2025?.” Diabetes Care 48 …CMOS wants
“…?”with no added period. The 2026-10-14 cmt.blog citation pass hit this on three Sources entries (posts 94341, 3766, 606), which were corrected by hand.Cause
The stray period comes from citeproc-php itself, not from the plugin's en-US "move the period inside the quotes" swap. Rendering a
?title raw with Chicago gives“What Is It?.”: citeproc-php moves the title's.suffix inside the quote without checking for terminal punctuation. It affects every style that quotes titles and ends the title with a period: Chicago notes-bibliography, Chicago author-date and MLA 9. APA, Harvard, IEEE, Vancouver, OSCOLA and ABNT were already correct.Fix
bibliography_builder_normalize_formatted_text()now removes a period that follows?or!, with or without a closing”/’. Commas are left alone: CMOS keeps a comma after a question-mark title (“Are You a Doctor?,”), and IEEE's“…?,”is unchanged.Tests (test-first)
CslStyleGoldenTest::test_title_ending_in_question_or_exclamation_mark_takes_no_period. It covers a webpage and an article-journal ending in?and a webpage ending in!, with exact expected strings for Chicago notes-bibliography and MLA 9. It also asserts that no bundled style emits?./!.. Before the fix it failed with the?.”output above.tests/fixtures/csl-styles/*.txtfile changed, because the corpus has no?/!titles, so the CMOS 18 et-al. output (first three authors + et al. for 7+) is untouched.Editor (citeproc-js) path
The editor has no client-side citeproc.
src/lib/formatting/csl.jsposts the CSL items to the plugin's format REST endpoint, which uses this same PHP formatter, so the fix applies in the editor too. citeproc-js (citeproc2.4.63) is only a dev dependency, used bysrc/lib/__test-utils__/citeproc-runner.jsfor sort conformance. I ran the same three items through it with the packaged Chicago NB, Chicago AD and MLA styles. It already renders“…Expressivity?” MedlinePlus. …,“…What’s New in 2025?” Diabetes Care 48 (2025): 1–10.and“Stop the Presses!” Site. …, and the PHP output now matches it character for character.Not covered
Bibliographies saved earlier keep the stored
?.”text until they are reformatted or saved again.🤖 Generated with Claude Code