Skip to content

fix(html): use div[role=note] for admonitions instead of blockquote#3115

Open
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/admonition-role-note-3026
Open

fix(html): use div[role=note] for admonitions instead of blockquote#3115
leno23 wants to merge 1 commit into
rust-lang:masterfrom
leno23:fix/admonition-role-note-3026

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Render styled admonitions ([!NOTE], [!TIP], etc.) as <div role="note"> instead of <blockquote>
  • Keep existing blockquote-tag CSS classes for styling compatibility
  • Plain blockquotes without an admonition kind remain <blockquote> elements

Motivation

Admonitions are callouts, not quotations. Using blockquote is semantically incorrect and can confuse screen readers. role="note" better matches their purpose (see #3026).

Test plan

  • cargo test markdown::admonitions (snapshots updated)
  • cargo test -p mdbook-html

Fixes #3026

Made with Cursor

Styled admonitions are callouts, not quotations. Use a div with
role="note" for accessibility while keeping blockquote-tag classes
for styling. Plain blockquotes without an admonition kind stay as
blockquote elements.

Fixes rust-lang#3026

Co-authored-by: Cursor <cursoragent@cursor.com>
@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTML semantics for admonitions

2 participants