fix(site): add explicit whitespace between inline elements - #54
Merged
Conversation
Astro applies JSX whitespace rules to templates, so a newline between two
inline elements collapses to no whitespace text node at all. Registry pages
rendered "cited),citation systems", "SeeURL layout" and record IRIs glued to
the JSON link. CSS margins masked some cases visually, but the document text
stayed wrong for copy/paste, screen readers and the Pagefind index.
Add explicit {' '} separators across the registry index, all four record
templates, the paginated reference lists, the alias list and the record
layout header.
Closes textrefs#53
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes the missing-whitespace defect reported in #53.
Cause
Astro applies JSX whitespace rules to
.astrotemplates — including the top-level HTML template, not just.map()bodies. A text node's leading/trailing whitespace is deleted when it contains a newline, so a line break between two inline elements yields no whitespace text node.<p>\n a,\n <strong>b</strong>renders asa,b.CSS masks part of it (
.reg-tag { margin-right: .4rem }, flexgap), but the document text stays wrong for copy/paste, assistive technology, text extraction and the Pagefind search index.Fix
Explicit
{' '}separators — already the idiom in this repo (src/components/RegistrySnapshot.astro). No wording, markup or styling changes.src/pages/reg/index.astro— the five prose cases from the issue (cited),citation systems,SeeURL layout,for how/id/,and/api/ fit,or thespecification)./id/work/,/id/system/,/id/mapping/,/id/ref/) — the.reg-subheader, where the record IRI ran into the JSON link (…aristotle.nicomachean-ethicsJSON) and the type/status chips ran into each other./id/ref/and/id/mapping/label↔value pairs (Work:,Citation system:,Subject:,Target:)./id/ref/transcription chips (provider link ↔ edition ↔ access ↔ license),/id/work/mapping rows (two adjacent anchors)./reg/work/…/refs/,/reg/system/…/refs/) — back-link ↔draftchip.AliasList.astro, and theRecordPage.astrosite header (TextRefsUnstable preview). Whitespace-only text nodes are ignored in flex layout, so the flex headers are unchanged visually.Verification
npm run verify:fastgreen. Built output re-scanned:Targets
staging, so it rides along in release PR #4.Closes #53
🤖 Generated with Claude Code