Skip to content

Let annotations set titles in italics - #323

Merged
dknauss merged 3 commits into
mainfrom
claude/borges-annotation-italics
Nov 30, 2026
Merged

dknauss merged 3 commits into
mainfrom
claude/borges-annotation-italics

Conversation

@dknauss

@dknauss dknauss commented Nov 30, 2026

Copy link
Copy Markdown
Owner

Requested by Dan · project thread

Why

Annotations were plain text, so a title named in a note ("builds on The Human Condition") printed in roman, against every style's rule that titles are italic. This blocks moving hand-built annotated lists (Distant Early's "Recommended" section) into Borges without losing italics.

What

  • Storage: annote keeps <i>…</i> around plain text on one line (CSL-JSON's rich-text italics; <em> is stored as <i>). Everything else is still stripped. JS normalizeAnnotationText() and PHP bibliography_builder_normalize_annotation_text() mirror each other, using private-use markers (U+E004/U+E005) while stripping, the same way nocase spans are kept.
  • Editor: the Annotation field shows <i>Title</i> as *Title* and stores *Title* back as <i> (field editor and manual entry). An asterisk next to a space, letter, or digit (* * *, 2*3*4) stays as typed. Help text says so.
  • Output: save(), the editor list, and the PHP port print the runs as <i> and escape the rest (getAnnotationSegments() / bibliography_builder_save_annotation_html()), so a stray <i> or <here> shows as text.
  • Exports: RIS N1 drops the tags; CSL-JSON keeps <i>; BibTeX/BibLaTeX write \textit{} (citation-js), which imports back as <i>.
  • No deprecation: no stored annotation held <i> before (the sanitizer stripped it), so saved blocks render identically. New annotations-italics save-parity fixture pins JS and PHP.

Testing

  • npx jest (full): 1714 passed
  • composer test:php: 893 passed, incl. new sanitizer/render tests and the parity fixture
  • npm run lint:js (one pre-existing warning), format:check, typecheck:js, lint:php, verify-metrics.sh: pass
  • Psalm not run locally (needs PHP ≥ 8.3.16); CI runs it.

Pairs with #322 (annotation styling). Whichever merges second needs docs/current-metrics.md re-derived.


Generated by Claude Code

An annotation was plain text, so a title named in a note printed in
roman. The Annotation field now stores *Title* as <i>Title</i>
(CSL-JSON's rich-text italics) and shows it back as *Title*. The
sanitizers keep <i>/<em> runs around plain text on one line and strip
everything else; save(), the editor list, and the PHP port print the
runs as <i>. RIS drops the tags; BibTeX writes \textit{}, which
imports back as <i>. A new annotations-italics save-parity fixture
pins JS and PHP. No stored annotation held <i> before, so saved
blocks are unchanged and need no deprecation.

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

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Plugin readme preview

Open preview · Commit ee8bb9f

37 passed · 0 warnings · 0 notes

Passed checks (37)
  • 145 / 150 characters in the short description.
  • Plugin name header recognized.
  • License header recognized: GPLv2 or later.
  • 5 tags accepted within the five-tag limit.
  • Description is within the parser’s word limit.
  • Installation is within the parser’s word limit.
  • Faq is within the parser’s word limit.
  • Changelog is within the parser’s word limit.
  • Tested up to 7.1, the latest WordPress major release.
  • Stable tag is declared: 1.22.0.
  • The PHP Version header is declared: 1.22.0.
  • Stable tag matches the PHP Version header: 1.22.0.
  • The readme “Requires at least” value is valid: 6.4.
  • The PHP “Requires at least” header is a numeric version: 6.4.
  • “Requires at least” matches between the readme and PHP header: 6.4.
  • The readme “Requires PHP” value is valid: 8.1.
  • The PHP “Requires PHP” header is a numeric version: 8.1.
  • “Requires PHP” matches between the readme and PHP header: 8.1.
  • “Tested up to” 7.1 meets the minimum WordPress version 6.4.
  • Installation content is present.
  • FAQ content is present.
  • Changelog content is present.
  • Screenshot captions are present.
  • The first changelog release matches Stable tag: 1.22.0.
  • The first changelog release matches PHP Version: 1.22.0.
  • Banner image loaded.
  • Plugin icon loaded.
  • Screenshot 1 has a matching image and caption.
  • Screenshot 2 has a matching image and caption.
  • Screenshot 3 has a matching image and caption.
  • Screenshot 4 has a matching image and caption.
  • Screenshot 5 has a matching image and caption.
  • Screenshot 6 has a matching image and caption.
  • Screenshot 7 has a matching image and caption.
  • Screenshot 8 has a matching image and caption.
  • Screenshot 9 has a matching image and caption.
  • Plugin PHP header loaded.

Readme and PHP-header checks only; this does not test plugin runtime compatibility.

…ion-italics

# Conflicts:
#	SPEC.md
#	docs/current-metrics.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WPtgA3mvvkn8io7SnJ1CxT
@codecov

codecov Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.41%. Comparing base (eedff29) to head (ee8bb9f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/annotation.js 89.47% 0 Missing and 2 partials ⚠️
src/lib/csl-sanitize.js 88.88% 0 Missing and 1 partial ⚠️
src/save-markup.js 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #323      +/-   ##
============================================
+ Coverage     87.39%   87.41%   +0.02%     
  Complexity       67       67              
============================================
  Files           113      113              
  Lines         12760    12807      +47     
  Branches       1341     1348       +7     
============================================
+ Hits          11151    11195      +44     
  Misses          489      489              
- Partials       1120     1123       +3     

☔ 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.

@dknauss
dknauss marked this pull request as ready for review November 30, 2026 00:13
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-30T00:13:36.198402Z
We couldn’t complete this review. Comment @codex review to try again.
ee8bb9f 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@dknauss
dknauss merged commit c541044 into main Nov 30, 2026
25 checks passed
@dknauss
dknauss deleted the claude/borges-annotation-italics branch November 30, 2026 00:13
@dknauss dknauss mentioned this pull request Nov 30, 2026
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.

2 participants