Repository navigation
Make bibliographies read correctly in newsletters and feeds - #158
Merged
Merged
Conversation
Email clients and feed readers show post content without the block's stylesheet and script. Saved entries were <cite>s, italic by default, so a whole reference turned italic and titles lost their italics; with Cite / Export on, each entry also showed an expanded "Cite / Export", a dead "Copy citation" button, and blocked data: download links. - save() writes entries as <span class="bibliography-builder-entry-text">. - save() no longer writes the Cite / Export panel. Each <li> carries data-cite-text, -filename, -ris, -csl-json, and optional -bibtex and -biblatex; view.js builds the same panel on the page. The render filter passes translated labels in data-cite-labels, so view.js still needs no wp-i18n. Post content shrinks: no percent-encoded data URIs. - The block registers a render_email_callback (the email renderer that WooCommerce, MailPoet, Jetpack newsletters, and Newspack share), and feeds get the same output, so legacy posts arrive clean too: saved panel, scripts, and COinS dropped, entries upright. A new deprecation freezes the unreleased intermediate shape. The 1.11.0 deprecation from the particle-sort change was missing jsonLdItemList, so a 1.11.0 post whose order the particle sort changes would have opened as invalid; fixed, and its fixture regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #158 +/- ##
============================================
- Coverage 88.28% 88.27% -0.02%
Complexity 22 22
============================================
Files 61 62 +1
Lines 7291 7359 +68
Branches 690 699 +9
============================================
+ Hits 6437 6496 +59
- Misses 291 292 +1
- Partials 563 571 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The email callback wraps its output with the email editor's Table_Wrapper_Helper when the renderer is loaded; a namespaced stub now exercises that path. view.js gets a test for malformed label JSON and an entry without a filename. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
3 tasks done
dknauss
marked this pull request as ready for review
October 21, 2026 18:40
dknauss
pushed a commit
that referenced
this pull request
Oct 21, 2026
Resolves the metrics doc's list of included files (now twelve, with csl-sanitize.php and email-output.php) and drops the two functions #158 deliberately removed, save_cite_export and save_export_link, from the function inventory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
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.
Summary
Problem. In a Jetpack / WordPress.com newsletter, a Borges bibliography looked broken:
Cause. Email clients and feed readers show post content without the block's stylesheet and script, and the saved markup depended on both:
<cite>, which browsers italicize by default;<details>with a JS button anddata:download links.Fixes (2, 3 and 4 from the investigation):
save()writes each entry as<span class="bibliography-builder-entry-text">. Same class, so the CSS is unchanged. HTML defines<cite>as a work's title, not a whole reference, so this also fixes the semantics.view.js.<li>carriesdata-cite-text,-filename,-ris,-csl-json, and optional-bibtex/-biblatex.view.jsbuilds the same<details>panel on the page, with the same classes anddata-cite-export-filenamelinks, so the styles and the cite-export e2e selectors are unchanged.data-cite-labelsattribute from the existing render filter, soview.jsstill has nowp-i18n.data-attributes survive the post-content HTML filter for every role, unlike a<script>. Post content gets smaller because the percent-encodeddata:URIs are gone.includes/email-output.php):render_email_callback. That's the email renderer WooCommerce, MailPoet, Jetpack/WordPress.com newsletters and Newspack share; blocks without one get their saved HTML dropped into a table.render_blockfilter.data-cite-*data, the scripts and COinS, and set entries upright with an inline style. That covers posts saved before this change too, wherever the email is built on the site.Compatibility.
deprecated[0]freezes the unreleased intermediate shape (particle sort with<cite>and the saved panel). Older posts validate and switch to the new markup when next saved.jsonLdItemList: true. A 1.11.0 post whose order the particle sort changes would have opened as invalid. Fixed; the v13 fixture is regenerated and differs only in the JSON-LD.Which setups this covers:
Validation
npm run lint:js,lint:css,lint:i18n,format:check: passcomposer lint:php,composer analyze:php: passEmailOutputTest: current and legacy markup (v07, v13, v14), repeated-author spans, the feed filter, and callback registration.data-cite-labels.npm run buildandpackage:releasesucceed.view.jsis 3,156 bytes (1,272 gzipped), up from 1,449.composer verify:metricspasses.Checklist
[Unreleased]entryGenerated by Claude Code