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

feat(web): html tags inside plural and select messages #10696

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

michelheusschen
Copy link
Contributor

Adds support for using html tags in messages like {count, plural, other {<b>#</b> items}} which would previously result in an error. The implementation isn't perfect, because it parses/formats the plural and select parts twice. Suggestions to improve that are welcome.

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

After going through it many times I think I have a good grasp of what's happening. The code is as clean as it could be imo and I don't really have an idea of how to approach this differently, let alone a good one.

@alextran1502
Copy link
Contributor

On top of the FormatMessage component, can we add documentation of how this element can be used, the variation, and the message it will output?

@michelheusschen
Copy link
Contributor Author

I've added some documentation to the component

image

@alextran1502
Copy link
Contributor

Amazing! Thanks!

@alextran1502 alextran1502 merged commit ac51cad into main Jul 1, 2024
23 checks passed
@alextran1502 alextran1502 deleted the feat/web-tags-plural-select-messages branch July 1, 2024 16:54
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.

None yet

3 participants