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
Fix default messages extractor bug with line break escaping #22140
Fix default messages extractor bug with line break escaping #22140
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just 1 note
src/dev/i18n/utils.test.js
Outdated
expect( | ||
formatJSString(`Test | ||
multiline | ||
string`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's please add test with something like:
`text with 2
line-breaks and 2 \n\n
\n\n
for example
`
?
(and maybe toMatchSnapshot
will be easier?)
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…22140) * Fix default messages extractor bug with line break escaping * Change test case
6.x/6.5: 75a1769 |
Bug:
en.json
generated by default messages extraction tool contains not escaped line breaks ifdefaultMessage
contains more then one line break.Reason:
String.replace(string, string)
is not recursive.String.replace(RegExp, string)
should be used instead.How to test:
Jest test with described case has been added to
utils.test.js
.