Closed lucacasonato closed 1 month ago
See https://github.com/unicode-org/message-format-wg/blob/main/exploration/pattern-exterior-whitespace.md for previous discussion on this.
I am not sure how relevant that discussion is, as it focuses on trimming white space around unquoted patterns (like simple message). I however am only concerned about complex messages here, which can not contain unquoted patterns. Additionally the spec already agrees that quotes before quoted patterns are not meaningful: for example, the optional space between key
and quoted-pattern
in variant
shows this. I'm suggesting this is white space allowance is expanded to around the entire complex body.
The perhaps more relevant prior discussion is #610, where I hit the same issue.
With #812 I have added this to the agenda of the 2024-07-01 call. Note that leading whitespace conflicts with simple message processing, as described in the PEWS design document @catamorphism linked above.
Also see this previous ballot https://github.com/unicode-org/message-format-wg/issues/505 with related discussion thread https://github.com/unicode-org/message-format-wg/issues/507
The WG agreed to permit opening and trailing whitespace in complex messages. Waiting to merge #854 to close this issue.
Currenly, complex messages can not start or end with whitespace. The first character of a complex message must either be
.
or{
, and the final character must be}
. This is unfortunate, because this results in unnecessary complexity for users.Example:
This does not work right now, because there is whitespace between the string start, and the first char of the complex message, and the trailing
}
and the end of the string.This can not be remedied by just trimming all messages, because for simple messages, leading and trailing whitespace is significant.
For complex messages, leading and trailing whitespace is not significant, because all chars outside of a
quoted-pattern
are control characters and not relevant for display (they are not included in the output message).To fix this,
complex-message
grammar can be changed as follows: