Skip to content

Add a "Repeated authors" block setting (repeatedAuthorMark) - #268

Merged
dknauss merged 9 commits into
mainfrom
claude/project-thread-endvly
Nov 9, 2026
Merged

dknauss merged 9 commits into
mainfrom
claude/project-thread-endvly

Conversation

@dknauss

@dknauss dknauss commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Requested by Dan · project thread

Closes #242.

Summary

What changed? A new block attribute, repeatedAuthorMark, sets how an entry by the same authors as the entry before it begins. It appears in the sidebar as Repeated authors, just under Citation Style.

Value Effect Offered by
style (default) The style's own rule: MLA 9's ‑‑‑, OSCOLA 5's ——, full names everywhere else every style
none Writes names out, even in MLA and OSCOLA MLA, OSCOLA (it's the same as style elsewhere)
dash Chicago 17's 3-em dash, ———. (three U+2014) Chicago NB, Chicago Author-Date
underscore NBR 6023:2002's six underscores plus a period, ______. ABNT
  • Each style's optional marks are listed in repeatedAuthorMarks in includes/styles.json. A mark the style doesn't offer (say dash left over after switching to APA) falls back to style. Switching back to Chicago brings the dash back.
  • This reuses the existing matcher and its strict rules: author lists must match field for field, entries with manual text keep their names, names stay in screen-reader-text, and only the saved bibliography carries the mark.
  • New name writers follow the bundled CSL:
    • Chicago: the first author is inverted (with the particle demoted), there's a comma before "and", and 7 or more authors become 3 plus "et al.".
    • ABNT: names are written FAMILY, Given;, and 4 or more authors become the first plus "et al.". Names with particles or suffixes are skipped, because citeproc decides how they're capitalized.
  • The JS is src/lib/repeated-authors.js and its PHP port is in includes/save-display.php. Five new save-parity fixtures pin them to each other.
  • The setting is also wired through the write-routes settings PATCH (it's validated, and a bad value gets 400), the read model and abilities, and wp borges list --fields.
  • Docs updated: docs/csl-styles.md, SPEC.md, both readmes, docs/rest-write-routes.md, docs/wp-cli.md, the CHANGELOG, and docs/current-metrics.md.

Why? Chicago 18 (§13.72) and NBR 6023:2018 now ask for the names to be repeated, but some writers and journals still use the older marks. Some readers find MLA's and OSCOLA's marks unclear.

Existing blocks / deprecation: a block without the attribute counts as style, so save() writes the same bytes as before. The deprecation chain ignores the setting, because only save.js passes repeatedAuthorMarkSetting. No deprecation entry is needed, and all existing deprecation and save-parity tests pass unchanged.

How the issue's open questions were settled:

  • Sources: Chicago 18 "What's New" (13.72) says Chicago "now prefers repeating the name of the author(s) rather than using a 3-em dash". The PUCRS and ESPM ABNT guides say the 2002 rule was "traço sublinear (equivalente a seis espaços) e ponto", and that the 2018 norm "não aceita mais" it.
  • Editors: Chicago 17's ———, ed. form isn't applied. Editor-only entries keep their names.
  • Titles: ABNT's repeated title isn't replaced. No source I could reach settled the 2002 title rule.
  • Author-date: dash also applies to Chicago Author-Date.
  • Site default: the bibliography_builder_output_defaults filter doesn't carry this setting yet. That could be a small follow-up.
  • Playground demo: updated.
    • The Chicago Notes-Bibliography example uses the dash.
    • The ABNT example uses the underscore line, with a second Freyre book added so there's a repeated author.
    • The MLA example points to the setting.
    • The OSCOLA and ABNT descriptions now call out the 1.19.1 fixes: roman titles, the SI number, and particles in the JSON-LD.
    • The readme blueprint installs the released ZIP, so the Chicago and ABNT descriptions say the marks need 1.20.0 or later. The main-build blueprint shows them now.
    • I checked locally with the PHP formatter and save port that the dash lands on "The Library of Babel" and the underscore line on Sobrados e mucambos.
  • Version: @since notes say 1.20.0, since this is a new feature after 1.19.1.

Validation

  • npm run lint:js passes
  • npm run lint:css passes
  • npm run lint:i18n passes when source strings or translation docs change
  • npm run test passes (1383 tests), plus composer test:php (752), composer lint:php, typecheck:js, format:check, and verify-metrics.sh
  • npm run build succeeds
  • Tested in the block editor (add block, paste DOI/BibTeX, verify output). Not done here; Psalm is left to CI (it needs a newer local PHP)

Checklist

  • Linked issue or explained why none was needed
  • No sensitive details disclosed publicly

🤖 Generated with Claude Code

https://claude.ai/code/session_01WPtgA3LdeYWKQDeeEStxi9

A new block attribute, repeatedAuthorMark (style, dash, underscore, none),
chooses how an entry by the same authors as the entry before it begins:

- style (default): the style's own rule, MLA 9's hyphens or OSCOLA 5's
  double em dash, so existing blocks save byte-for-byte as before;
- dash: Chicago 17's 3-em dash (three U+2014), offered by both Chicago
  styles (Chicago 18 §13.72 now prefers repeating the names);
- underscore: NBR 6023:2002's six underscores, offered by ABNT (dropped in
  the 2018 revision);
- none: always write names out, even in MLA and OSCOLA.

Which style offers which mark is repeatedAuthorMarks in styles.json; a
mark the style does not offer falls back to style. Names are matched as
strictly as MLA's, written the way the bundled Chicago and ABNT CSL write
them. JS save() and the PHP port agree (new save-parity fixtures). The
sidebar shows a "Repeated authors" select for styles with a choice; the
settings PATCH, read model, abilities, and wp borges list carry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPtgA3LdeYWKQDeeEStxi9
@dknauss dknauss self-assigned this Nov 9, 2026
…und demo

- Chicago Notes-Bibliography example: repeatedAuthorMark "dash", so the
  second Borges entry starts with Chicago 17's 3-em dash.
- ABNT example: a second Freyre book and repeatedAuthorMark "underscore"
  (NBR 6023:2002's line); the description also notes that JSON-LD keeps
  "de" in Sérgio Buarque de Holanda (1.19.1, #248).
- MLA example: says the sidebar setting can write the names out.
- OSCOLA example: calls out the roman titles in its tables and the SI
  number (1.19.1, #246, #247).
- Features list: a Repeated authors entry.

Blueprints regenerated with npm run playground:build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPtgA3LdeYWKQDeeEStxi9
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.95722% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.42%. Comparing base (6a00c92) to head (12a51a9).

Files with missing lines Patch % Lines
src/lib/repeated-authors.js 60.00% 0 Missing and 22 partials ⚠️
src/components/repeated-author-mark-control.js 70.58% 0 Missing and 5 partials ⚠️
includes/save-display.php 98.48% 1 Missing ⚠️
src/edit.js 0.00% 1 Missing ⚠️
src/save-markup.js 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #268      +/-   ##
============================================
- Coverage     88.51%   88.42%   -0.09%     
  Complexity       67       67              
============================================
  Files           104      105       +1     
  Lines         11168    11313     +145     
  Branches       1007     1032      +25     
============================================
+ Hits           9885    10004     +119     
- Misses          444      446       +2     
- Partials        839      863      +24     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Dan saw no hyphens in the MLA example: they are only on the published
page, because the editor list keeps full names. The MLA description now
says so in plain terms, names the entries that get them, and links to
the published block (new anchor demo-mla-9). The Chicago and ABNT
descriptions say the same, and ABNT links to its block (demo-abnt).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPtgA3LdeYWKQDeeEStxi9
@dknauss
dknauss marked this pull request as ready for review November 9, 2026 05:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T05:57:03.012458Z 3039b20 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Resolve the CHANGELOG (both Added entries kept), regenerate the
Playground blueprints, and refresh the line counts in
docs/current-metrics.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPtgA3LdeYWKQDeeEStxi9
@dknauss
dknauss merged commit dcaa810 into main Nov 9, 2026
22 checks passed
@dknauss
dknauss deleted the claude/project-thread-endvly branch November 9, 2026 06:03
@dknauss dknauss mentioned this pull request Nov 9, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optional repeated-author mark for styles that now repeat names (Chicago 3-em dash, ABNT underscore line)

2 participants