Skip to content

Commit fafd337

Browse files
committed
Avoid breaking up algorithm steps with NOTE
1 parent 58afcfa commit fafd337

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

spec/formatting.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -936,18 +936,8 @@ The _Default Bidi Strategy_ is defined as follows:
936936
right-to-left directionality, and to the message's directionality not being known.
937937
1. For each _expression_ `exp` in _pattern_:
938938
1. Let `fmt` be the formatted string representation of the _resolved value_ of `exp`.
939-
1. Let `dir` be the directionality of the _resolved value_ of `exp`,
939+
1. Let `dir` be `DIR(exp)`,
940940
one of « `'LTR'`, `'RTL'`, `'unknown'` », with the same meanings as for `msgdir`.
941-
> [!NOTE]
942-
> _Resolved values_ need to track two different pieces of metadata about directionality:
943-
> the "isolate" flag (see the next step for how that is used), which determines
944-
> whether the formatted result needs to be isolated; and the directionality itself.
945-
> Each _function handler_ can have its own means for determining the directionality
946-
> of the _resolved value_ it returns.
947-
> Alternately, an implementation could elide this tracking and instead determine
948-
> the directionality from the locale.
949-
> The directionality SHOULD NOT be determined by introspecting
950-
> the character sequence in `fmt`.
951941
1. Let the boolean value `isolate` be
952942
True if the `u:dir` _option_ of the _resolved value_ of `exp` has a value other than `'inherit'`,
953943
or False otherwise.
@@ -967,4 +957,20 @@ The _Default Bidi Strategy_ is defined as follows:
967957
prefix `fmt` with U+2068 FIRST STRONG ISOLATE
968958
and postfix it with U+2069 POP DIRECTIONAL ISOLATE.
969959
960+
The auxiliary function `DIR`, which maps an _expression_ to one of
961+
« `'LTR'`, `'RTL'`, `'unknown'` », is expected to be defined using the
962+
_resolved value_ of the _expression_. An implementation can use
963+
a representation of _resolved values_ that tracks two different
964+
pieces of metadata about directionality: the `isolate` flag used in step 2(iii),
965+
and the directionality itself. Each _function handler_ can have its own means
966+
for determining the directionality annotation on the _resolved value_ it returns.
967+
Alternately, an implementation could simply compute `DIR(exp)` based on the
968+
locale.
969+
970+
> [!NOTE]
971+
> `DIR(exp)` SHOULD NOT be determined by introspecting
972+
> the character sequence in the formatted string representation
973+
> of the resolved value of `exp`.
974+
975+
970976

0 commit comments

Comments
 (0)