@@ -273,6 +273,39 @@ Not allowing these to mix could produce annoying parse errors.
273
273
274
274
_Describe the proposed solution. Consider syntax, formatting, errors, registry, tooling, interchange._
275
275
276
+ I propose adopting a hybrid approach in which we permit "super-loose isolation".
277
+ This allows user to include isolates and strongly directional characters into the whitespace
278
+ portions of the syntax in order to make messages appear correctly.
279
+
280
+ The second part of the hybrid approach would be to recommend ("SHOULD") the "strict isolation"
281
+ design for serializers.
282
+ (Note that "strict" and "super-loose" use non-identical productions with the name `bidi`.
283
+ These serve different purposes and are consistent with strict being narrower with super-loose.)
284
+ This syntax is a subset of the super-loose syntax and can be applied selectively to messages that
285
+ have RTL sequences or which have problematic display.
286
+
287
+
288
+ ## Alternatives Considered
289
+
290
+ _What other solutions are available?_
291
+ _How do they compare against the requirements?_
292
+ _What other properties they have?_
293
+
294
+ ### Nothing
295
+ We could do nothing.
296
+
297
+ A likely outcome of doing nothing is that RTL users would insert bidi controls into
298
+ _messages_ in an attempt to make the _pattern_ and/or _placeholders_ display correctly.
299
+ These controls would become part of the output of the _message_,
300
+ showing up inappropriately at runtime.
301
+ Because these characters are invisible, users might be very frustrated trying to manage
302
+ the results or debug what is wrong with their messages.
303
+
304
+ By contrast, if users insert too many or the wrong controls using the recommended design,
305
+ the _message_ would still be functional and would emit no undesired characters.
306
+
307
+ ### LTR Messages with isolating sequences
308
+
276
309
The syntax of a _message_ assumes a left-to-right base direction
277
310
both for the complete text of the _message_ as well as for each line (paragraph)
278
311
contained therein.
@@ -383,7 +416,7 @@ ns-separator = [bidi] ":"
383
416
bidi = [ %x200E-200F / %x061C ]
384
417
```
385
418
386
- ### Open Issues with Proposed Design
419
+ ** Open Issues**
387
420
388
421
The ABNF changes found above put isolates and strongly directional marks into specific locations,
389
422
such as directly next to ` { ` /` } ` /` {{ ` /` }} ` markers
@@ -393,32 +426,24 @@ A more permissive design would add the isolates and strongly directional marks t
393
426
whitespace in the syntax and depend on users/editors to appropriately pair or position the marks
394
427
to get optimal display.
395
428
396
- ## Alternatives Considered
397
-
398
- _ What other solutions are available?_
399
- _ How do they compare against the requirements?_
400
- _ What other properties they have?_
401
-
402
- ### Nothing
403
- We could do nothing.
404
-
405
- A likely outcome of doing nothing is that RTL users would insert bidi controls into
406
- _ messages_ in an attempt to make the _ pattern_ and/or _ placeholders_ display correctly.
407
- These controls would become part of the output of the _ message_ ,
408
- showing up inappropriately at runtime.
409
- Because these characters are invisible, users might be very frustrated trying to manage
410
- the results or debug what is wrong with their messages.
411
-
412
- By contrast, if users insert too many or the wrong controls using the recommended design,
413
- the _ message_ would still be functional and would emit no undesired characters.
414
429
415
430
### Super-loose isolation
416
431
417
432
Add isolates and strongly directional marks to required and optional whitespace in the syntax.
418
433
This would permit users to get the effects described by the above design,
419
434
as long as they use isolates/marks in a "responsible" way.
420
435
421
- (Omitting other changes found in #673 )
436
+ The exception to this is the namespace separator, used in ` identifier ` .
437
+ This requires the ability to insert isolates or strongly directional marks
438
+ between the namespace and name portions, where whitespace is not permitted.
439
+ This is the only location in the syntax where such characters might be needed
440
+ but whitespace is not at least optional.
441
+ This could be defined as:
442
+ ``` abnf
443
+ ns-separator = [bidi] ":" [bidi]
444
+ ```
445
+
446
+ Here are the other ABNF changes:
422
447
423
448
``` abnf
424
449
; strongly directional marks and bidi isolates
@@ -447,7 +472,7 @@ s = ( SP / HTAB / CR / LF / %x3000 )
447
472
### Strict isolation all the time
448
473
449
474
Apply bidi isolates in a strict way.
450
- The main differences to the proposed solution is :
475
+ In this design :
451
476
1 . The open/close isolate characters are syntactically required to be paired.
452
477
This introduces parse errors for unpaired invisible characters,
453
478
which could lead to bad user experiences.
@@ -467,7 +492,7 @@ markup = "{" [s] "#" identifier [bidi] *(s option) *(s attribute) [s] ["
467
492
/ "{" [s] "/" identifier [bidi] *(s option) *(s attribute) [s] "}" ; close
468
493
/ "{" LRI [s] "/" identifier [bidi] *(s option) *(s attribute) [s] close-isolate "}" ; close
469
494
identifier = [(namespace ns-separator)] name
470
- ns-separator = [bidi] ":"
495
+ ns-separator = [bidi] ":" [bidi]
471
496
bidi = [ %x200E-200F / %x061C ]
472
497
```
473
498
@@ -610,6 +635,8 @@ adherence to the stricter grammar.
610
635
syntax errors
611
636
- Provides a foundation for tools to claim strict conformance and message normalization
612
637
as well as guidance to implementers to make them want to adopt it
638
+ - Messages are valid while being edited (such as when the open or close isolate has been
639
+ inserted but the corresponding opposite isolate hasn't been entered yet)
613
640
614
641
** Cons**
615
642
- Requires additional effort to maintain the grammar
0 commit comments