Skip to content
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

Use ZWSP instead of WBR #346

Merged
merged 8 commits into from
Oct 29, 2023
Merged

Use ZWSP instead of WBR #346

merged 8 commits into from
Oct 29, 2023

Conversation

tushuhei
Copy link
Member

@tushuhei tushuhei commented Oct 28, 2023

This changes the default separator from WBR to ZWSP.

We observed that some screen readers split their text focus by chunks because of the inserted WBR elements. We also considered adding the aria-hidden="true" attribute to the WBR elements as a workaround, but the behavior was still not ideal and stable. On the other hand, the ZWSP approach does not split the text focus and works better because it does not alter the DOM tree structure. Considering that, I suggest to use ZWSP as the default separator for accessibility improvement.

Users can still use WBR tags if it's preferred by specifying the separator element.

import {jaModel, HTMLProcessingParser} from 'budoux';
const parser = HTMLProcessingParser(jaModel, {separator: document.createElement('wbr')});

kojiishi
kojiishi previously approved these changes Oct 29, 2023
Copy link
Collaborator

@kojiishi kojiishi left a comment

Choose a reason for hiding this comment

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

LGTM w/nit, thanks!

@tushuhei
Copy link
Member Author

Thanks for reviewing!

@tushuhei tushuhei merged commit 651fd4e into main Oct 29, 2023
39 checks passed
@tushuhei tushuhei deleted the zwsp branch December 12, 2023 08:33
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.

2 participants