Skip to content

Hide decorative characters from screen readers - #142

Open
MaggieCabrera wants to merge 1 commit into
trunkfrom
claude/clever-almeida-2e1bd3
Open

MaggieCabrera wants to merge 1 commit into
trunkfrom
claude/clever-almeida-2e1bd3

Conversation

@MaggieCabrera

Copy link
Copy Markdown
Contributor

Description

Part of #44, for Alternative text on images and graphics. Screen readers no longer read out the theme's decorative characters: the · and › separators in post meta, the › in Read more, the ↑ in Back to top, the dot before comment Reply links, and the quote mark and dash on quotes and pullquotes.

Before, each one was exposed as text, so JAWS said "dot", VoiceOver said "middle dot", NVDA said "up arrow", and Read more links were named "Read more › : Post title". The images and icons passed the audit, so this only covers characters.

  • Characters in patterns are wrapped in <span aria-hidden="true">, as the guideline asks. The blocks stay valid, and the spans survive editing.
  • Characters added with CSS get empty alternative text (content: "·" / ""), like the Quote Mark block style already does.
  • The theme validator now ignores markup inside text attributes, so the span in the Read more text isn't reported as untranslated text.

Screenshots

No visual change.

Testing Instructions

  1. Import the accessibility test content.
  2. View the blog home, a category archive, search results, and the "Template: Comments" post. The separators, chevrons and quote marks still show.
  3. Check them in Chrome's DevTools, in Elements > Accessibility with the full-page accessibility tree turned on, or with a screen reader. There's no text node for ·, ›, ❝ or —, and Read more links are named "Read more : Post title".
  4. Insert the Footer Subscribe pattern. Its link is named "Back to top".
  5. Open the templates in the Site Editor. There are no block recovery warnings.
  6. Switch to a dark variation such as Evening. The characters still show.

I checked every template, including the sidebar variants, and every pattern, on the front end, in the Site Editor, and in the default and Evening variations, with WordPress 7.1.3 and Gutenberg 24.1.0.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Auditing the theme against the guideline, writing and testing the fix, and drafting this description.

🤖 Generated with Claude Code

The separators, chevrons, arrow, quote marks and citation dashes are
decorative, but screen readers announced them. Wrap the ones in patterns
in aria-hidden spans, and give the CSS-generated ones empty alternative
text, like the Quote Mark block style already does.

The theme validator now ignores markup inside text attributes, so the
span in the Read more text isn't reported as untranslated text.

Part of #44.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Patterns Issues or PRs that touch the theme's block patterns. labels Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
Co-authored-by: rvpatel <ravipatel@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@rvpatel

rvpatel commented Oct 23, 2026

Copy link
Copy Markdown

Tested on WordPress 7.2-beta1 with this PR on current Ipsum trunk (merges cleanly), front page, Chromium.

  • Before: 30 decorative · / › characters were exposed to assistive technology.
  • After: all 30 are inside aria-hidden="true", none exposed. ✅

Checked by walking the DOM text nodes and testing whether each character sits inside an aria-hidden element. Not tested: the "Read more ›" link (no read-more links on the front page) and a real screen reader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. [Area] Patterns Issues or PRs that touch the theme's block patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants