Repository navigation
Conversation
…initials GIVEN_FIRST_NAME let a dotted run of initials repeat without limit inside a repeated given-name group, so a long line of initials could be split many ways before the family name failed to match. OSCOLA patterns run for every style, so a 2.4 KB pasted line held the editor for about 9 seconds. Bound the run at four initials, which still reads every real name, and add a timing regression test. Fixes #327. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPtgA2by7WV5UC9oYaXWwd
The fix ships alone as 1.23.1 from the v1.23.0 tag, so its CHANGELOG entry moves from Unreleased to a 1.23.1 section, and readme.txt gets the same changelog line and upgrade notice the patch release carries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WPtgA2by7WV5UC9oYaXWwd
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #329 +/- ##
=========================================
Coverage 87.34% 87.34%
Complexity 67 67
=========================================
Files 115 115
Lines 12917 12917
Branches 1373 1373
=========================================
Hits 11282 11282
Misses 489 489
Partials 1146 1146 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Plugin readme previewOpen preview · Commit 35 passed · 2 warnings · 0 notes Warnings
Passed checks (35)
Readme and PHP-header checks only; this does not test plugin runtime compatibility. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Patch release from v1.23.0 with only the fix for #327: the OSCOLA given-name pattern no longer backtracks on a long run of initials, so a pasted line of hundreds of initials no longer freezes the editor. The same fix is on main for 1.24.0 in #329. Bump the plugin header, block.json, package.json, package-lock.json, and readme.txt's Stable tag to 1.23.1; add the CHANGELOG section, the readme.txt changelog and upgrade notice, the README release highlight, and the planning state baseline. Claude-Session: https://claude.ai/code/session_01WPtgA2by7WV5UC9oYaXWwd Co-authored-by: Claude <noreply@anthropic.com>
Requested by Dan · project thread
Fixes #327.
Summary
src/lib/free-text-oscola.js,GIVEN_FIRST_NAMEnow caps a dotted run of initials at four:(?:\s?\p{Lu}\.){0,3}instead of*. The docblock explains why. Every real name still reads, including "H. L. A. Hart", "H.L.A. Hart", "HLA Hart", "Jean-Paul Sartre", "Mary O’Brien", and "J. R. R. R. Tolkien".(?:…\s+){1,3}. On a long line of initials, the regex could split them between the two in many ways before the$-anchored family name failed, so backtracking grew about cubically. OSCOLA patterns are tried in every style, so a 2.4 KB pasted line (A. A. A. …, ‘Title’ (2001) 12 LQR 34) froze the editor for about 9 seconds whatever the block's style. This turned up in the independent ReDoS review of Read ABNT and OSCOLA citations pasted as text #320.docs/current-metrics.md: the JS source line count goes up by 5, for the docblock.Validation
npm run lint:jspasses for the changed files (eslintandprettier --check)npm run lint:csspasses (no CSS changed)npm run lint:i18npasses when source strings or translation docs change (no strings changed)npm run test: the free-text and parser suites pass (460 tests). The full suite runs in CI.npm run buildsucceeds (CI)parseFreeTextCitation()must finish in under a second. With the old pattern it fails at 9,218 ms; with the fix it takes milliseconds. A second new test pins dotted initials up to four..github/scripts/verify-metrics.shpassesChecklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01WPtgA2by7WV5UC9oYaXWwd