Skip to content

Render italics and small caps in publication titles on cluster pages - #1083

Merged
LukasWallrich merged 9 commits into
rebrand-doorsfrom
clusters-title-markup
Nov 11, 2026
Merged

LukasWallrich merged 9 commits into
rebrand-doorsfrom
clusters-title-markup

Conversation

@LukasWallrich

@LukasWallrich LukasWallrich commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Publication titles on the cluster pages showed literal markup from Crossref, such as Promoting Research Integrity in <scp>A</scp>frica and Celebrating 30 years of <i>Feminism &amp; Psychology</i>. This PR renders that markup instead of stripping it.

  • Allow-list: a new partial, layouts/partials/clusters/rich_text.html, decodes entities and escapes the title. It then restores only <i>/<em> (as <i>) and <scp>, which becomes <span class="scp"> set in small caps. All other markup stays escaped text.
  • Where it applies: the recommended and compact cards in cluster_section.html and featured_cards.html.
  • static/js/featured-resources.js: the same rule (richText) applies to the reference popup and to reading-list titles and APA references. Copy-APA and the PDF export use plain text (plainText). Entities in APA references now show as & rather than &amp;.
  • CSS: .scp{font-variant:small-caps} is added. Card, popup and reading-list titles and APA references join the D15 exception that allows true italics in reference lists. In titles, the italic words keep the title's weight, but Doors has only a 400 italic face, so they render lighter.
  • Data still to come: titles with run-together words in Crossref ("Let's PublishFewerPapers") were fixed in the Publications sheet. The generator side of the cleanup is in Apply the clusters content decisions and fix two clusters parser bugs #1077, into main. Both arrive with the next data-processing run, and the templates work with the current data too.

Checks

  • hugo --gc --minify builds, the unit tests pass, and check_seo_html.py passes. New check 17 fails if cluster pages show literal <i>/<em>/<scp> markup.
  • The built cluster pages contain no &lt;i&gt;, &lt;scp, &lt;em or &amp;amp;.
  • Cluster pages were checked in Chrome:
    • Cluster 3: small caps show in the card, the popup title and the APA reference.
    • Cluster 4: italics show in a card title.
    • Cluster 10: italics show in a popup APA reference.

🤖 Generated with Claude Code

Publication titles from Crossref carry <i>, <em> and <scp> markup and HTML
entities, which the cluster cards showed as literal text. A new partial,
clusters/rich_text.html, escapes the title and restores only those tags
(scp as small caps). featured-resources.js does the same for the reference
popup and the reading list, and copies and exports plain text. The popup
and reading-list APA references join the D15 italics exception for
reference lists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LukasWallrich
LukasWallrich requested a review from a team as a code owner November 9, 2026 17:53
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

👍 All image files/references (if any) are in webp format, in line with our policy.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

✅ Spell Check Passed

No spelling issues found when checking 6 changed file(s)! 🎉

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 5 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

LukasWallrich and others added 2 commits November 9, 2026 17:59
…l markup

Card, popup and reading-list titles join the D15 exception for reference
lists, so journal names and species set in <i> are italic.
check_seo_html.py check 17 fails a build whose cluster pages show
&lt;i&gt;, &lt;em&gt; or &lt;scp&gt; as text or leave <scp> unrendered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RE2 has no backreferences, so <i> could close with </em>; the JS pairs them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread scripts/check_seo_html.py Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread scripts/check_seo_html.py Resolved
Check 17 now also matches &amp;lt;i&amp;gt; and fails when it scans no cluster
page, as the homepage checks do when there is no homepage. The minimal fixture
build in the tests gains a cluster page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LukasWallrich

LukasWallrich commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Note

🤖 Claude Opus 5.5 responding on behalf of Lukas Wallrich

@richarddushime, could you review this PR's code before it merges into rebrand-doors? Lukas asked for publication titles on cluster pages to render their Crossref <i>/<em> and <scp> markup rather than strip it. Checks pass, and a local build passes check_seo_html.py. Please look at three things:

  1. The escape-then-restore approach. layouts/partials/clusters/rich_text.html (Hugo) and richText() in static/js/featured-resources.js both unescape entities, HTML-escape everything, then restore only <i>, <em> and <scp> as <i> / <span class="scp">. The output goes through safeHTML and innerHTML. Can any title or APA string from the data get markup other than those tags through? decodeEntities() uses a detached <textarea>. Is that acceptable to you?
  2. assets/css/doors/base.css. This is the site-wide reset that forces font-style: normal. The PR adds exceptions so <i> is italic in .ref-apa, .rl-detail-apa and the four publication-title classes, and adds a global .scp { font-variant: small-caps }. Could any of these selectors hit something outside the cluster and reference-list components?
  3. Check 19 in scripts/check_seo_html.py (renumbered after Apply the content-review decisions to hand-written pages #1078 and Render Markdown in glossary term titles and related terms #1085 added checks 17 and 18) is a new hard failure: literal or double-escaped <i>/<em>/<scp> on any clusters/ page, or no cluster pages at all.

LukasWallrich and others added 2 commits November 9, 2026 19:50
#1078 added the breadcrumb check as check 17, so the cluster-title check
becomes check 18 and is listed in the script's docstring. Both checks and
their tests are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1085 took check 18 for glossary titles, so the cluster-title check is now
check 19, in both the docstring and the summary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LukasWallrich added a commit that referenced this pull request Nov 11, 2026
@LukasWallrich
LukasWallrich merged commit 87b4268 into rebrand-doors Nov 11, 2026
6 checks passed
@LukasWallrich
LukasWallrich deleted the clusters-title-markup branch November 11, 2026 19:18
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.

1 participant