Skip to content

Commit

Permalink
Trim string values in localized text objects
Browse files Browse the repository at this point in the history
  • Loading branch information
christianliebel committed Sep 27, 2024
1 parent 1629fd0 commit 6e5351c
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1420,28 +1420,39 @@ <h3>
</li>
<li>If |localizedValue:ordered map| is an [=ordered map=]:
<ol>
<li>If "value" [=map/exists=] in |localizedValue|, [=map/set=]
|normalizedValue|["value"] to |localizedValue|["value"].
<li>If "value" [=map/exists=] in |localizedValue| and
|localizedValue|["value"] is a [=string=], [=strip leading and
trailing ASCII whitespace=] from |localizedValue|["value"] and
[=map/set=] |normalizedValue|["value"] to
|localizedValue|["value"].
</li>
<li>If "lang" [=map/exists=] in |localizedValue|, [=map/set=]
|normalizedValue|["lang"] to |localizedValue|["lang"].
<li>If "lang" [=map/exists=] in |localizedValue| and
|localizedValue|["lang"] is a [=string=], [=strip leading and
trailing ASCII whitespace=] from |localizedValue|["lang"] and
[=map/set=] |normalizedValue|["lang"] to
|localizedValue|["lang"].
</li>
<li>If "dir" [=map/exists=] in |localizedValue|, [=map/set=]
|normalizedValue|["dir"] to |localizedValue|["dir"].
<li>If "dir" [=map/exists=] in |localizedValue| and
|localizedValue|["dir"] is a [=string=]:
<ol>
<li>[=Strip leading and trailing ASCII whitespace=] from
|localizedValue|["dir"].
</li>
<li>If [=text-direction list=] [=list/contains=]
|localizedValue|["dir"], [=map/set=]
|normalizedValue|["dir"] to |localizedValue|["dir"].
</li>
</ol>
</li>
</ol>
</li>
<li>If "value" does not [=map/exist=] in |normalizedValue|, or
|normalizedValue|["value"] is not a [=string=], return.
<li>If "value" does not [=map/exist=] in |normalizedValue|, return.
</li>
<li>If "lang" does not [=map/exist=] in |normalizedValue|, or
|normalizedValue|["lang"] is not a [=string=], [=map/set=]
|normalizedValue|["lang"] to |defaultLanguageTag|.
<li>If "lang" does not [=map/exist=] in |normalizedValue|,
[=map/set=] |normalizedValue|["lang"] to |defaultLanguageTag|.
</li>
<li>If "dir" does not [=map/exist=] in |normalizedValue|, or
[=text-direction list=] does not [=list/contain=]
|normalizedValue|["dir"], [=map/set=] |normalizedValue|["dir"] to
|defaultDirection|.
<li>If "dir" does not [=map/exist=] in |normalizedValue|,
[=map/set=] |normalizedValue|["dir"] to |defaultDirection|.
</li>
<li>If calling <a data-cite=
"ECMA-402#sec-isstructurallyvalidlanguagetag">IsStructurallyValidLanguageTag</a>
Expand Down

0 comments on commit 6e5351c

Please sign in to comment.