react-i18n: Add support for self-closing elements in formatHTML#7034
Merged
react-i18n: Add support for self-closing elements in formatHTML#7034
Conversation
changelog: Internal, Localization, Support self-closing HTML tags in localization helper
2 tasks
See: #7034 (comment) Co-Authored-By: Matt Gardner <5004319+allthesignals@users.noreply.github.com>
2 tasks
allthesignals
approved these changes
Sep 30, 2022
Merged
jskinne3
pushed a commit
that referenced
this pull request
Oct 12, 2022
* Split, convert react-i18n package to TypeScript * react-i18n: Add support for self-closing elements in formatHTML changelog: Internal, Localization, Support self-closing HTML tags in localization helper * Add documentation for react-i18n * Run Prettier on README * Add (failing) regression coverage for dropped text See: #7034 (comment) Co-Authored-By: Matt Gardner <5004319+allthesignals@users.noreply.github.com> * Fix dropped text following self-closing tag Co-authored-by: Matt Gardner <5004319+allthesignals@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Context: #7029 (comment)
Previously,
formatHTMLwould only allow for balanced HTML tags (with an opening and closing tag), and would not support self-closing tags such as<br />or<img />. This pull request adds that support.For review: Note that this includes a TypeScript conversion and splits the original
index.jsto function-specific files. It will be easier to review each commit in isolation, where the actual fix is implemented in 7ad8244.📜 Testing Plan
Provide a checklist of steps to confirm the changes.
yarn testpasses