fix(localize): allow ICU expansion case to start with any character except }
(#36123)
Previously, an expansion case could only start with an alpha numeric character. This commit fixes this by allowing an expansion case to start with any character except `}`. The [ICU spec](http://userguide.icu-project.org/formatparse/messages) is pretty vague: > Use a "select" argument to select sub-messages via a fixed set of keywords. It does not specify what can be a "keyword" but from looking at the surrounding syntax it appears that it can indeed be any string that does not contain a `}` character. Closes #31586 PR Close #36123
This commit is contained in:

committed by
Misko Hevery

parent
1cb7b88505
commit
fced8ee40e
@ -747,7 +747,7 @@ function isNamedEntityEnd(code: number): boolean {
|
||||
}
|
||||
|
||||
function isExpansionCaseStart(peek: number): boolean {
|
||||
return peek === chars.$EQ || chars.isAsciiLetter(peek) || chars.isDigit(peek);
|
||||
return peek !== chars.$RBRACE;
|
||||
}
|
||||
|
||||
function compareCharCodeCaseInsensitive(code1: number, code2: number): boolean {
|
||||
|
Reference in New Issue
Block a user