Skip to content

✨(frontend) set empty alt for decorative images in blocknote editor #1282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Ovgodd
Copy link
Collaborator

@Ovgodd Ovgodd commented Aug 11, 2025

Purpose

Ensure decorative images in the BlockNote editor have an empty alt attribute
by default to meet RGAA 1.2 accessibility requirements and improve
screenreader experience.

issue 1073

Proposal

  • Set alt="" and relevant accessibility attributes for decorative images
  • Apply changes on initial render and on editor content change

@Ovgodd Ovgodd self-assigned this Aug 11, 2025
@Ovgodd Ovgodd force-pushed the fix/1073-alt-default-images branch from 4ec3212 to 9f90caa Compare August 11, 2025 10:36
@Ovgodd Ovgodd requested a review from AntoLC August 11, 2025 10:37
@Ovgodd Ovgodd marked this pull request as ready for review August 11, 2025 10:37
ensure decorative images have empty alt to comply with RGAA 1.2 accessibility

Signed-off-by: Cyril <[email protected]>
@Ovgodd Ovgodd force-pushed the fix/1073-alt-default-images branch from 9f90caa to db361ad Compare August 11, 2025 11:59
@AntoLC AntoLC linked an issue Aug 12, 2025 that may be closed by this pull request
Copy link
Collaborator

@AntoLC AntoLC left a comment

Choose a reason for hiding this comment

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

I made a proposal more Blocknote way, if you are find with this way, let's go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I like it this is clean just one little thing >


export const accessibleImageRender = (
block: BlockFromConfig<typeof imageBlockConfig, any, any>,
editor: BlockNoteEditor<any, any, any>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there any related type we can use instead of any with BlockNote?
Or should we default to unknown for stricter typing? WDYT?

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

Successfully merging this pull request may close these issues.

Don't set an alt attribute by default to images
2 participants