Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Allow locale based ignorePunctuation default #833

Merged
merged 6 commits into from
Feb 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions spec/collator.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,17 @@ <h1>InitializeCollator ( _collator_, _locales_, _options_ )</h1>
1. Set _collator_.[[Numeric]] to SameValue(_r_.[[kn]], *"true"*).
1. If _relevantExtensionKeys_ contains *"kf"*, then
1. Set _collator_.[[CaseFirst]] to _r_.[[kf]].
1. Let _dataLocale_ be _r_.[[dataLocale]].
1. Let _dataLocaleData_ be _localeData_.[[&lt;_dataLocale_&gt;]].
1. Let _sensitivity_ be ? GetOption(_options_, *"sensitivity"*, ~string~, &laquo; *"base"*, *"accent"*, *"case"*, *"variant"* &raquo;, *undefined*).
1. If _sensitivity_ is *undefined*, then
1. If _usage_ is *"sort"*, then
1. Let _sensitivity_ be *"variant"*.
1. Else,
1. Let _dataLocale_ be _r_.[[dataLocale]].
1. Let _dataLocaleData_ be _localeData_.[[&lt;_dataLocale_&gt;]].
1. Let _sensitivity_ be _dataLocaleData_.[[sensitivity]].
1. Set _collator_.[[Sensitivity]] to _sensitivity_.
1. Let _ignorePunctuation_ be ? GetOption(_options_, *"ignorePunctuation"*, ~boolean~, ~empty~, *false*).
1. Let _defaultIgnorePunctuation_ be _dataLocaleData_.[[ignorePunctuation]].
1. Let _ignorePunctuation_ be ? GetOption(_options_, *"ignorePunctuation"*, ~boolean~, ~empty~, _defaultIgnorePunctuation_).
1. Set _collator_.[[IgnorePunctuation]] to _ignorePunctuation_.
1. Return _collator_.
</emu-alg>
Expand Down Expand Up @@ -136,6 +137,7 @@ <h1>Internal slots</h1>
<li>The first element of [[SortLocaleData]].[[&lt;_locale_&gt;]].[[co]] and [[SearchLocaleData]].[[&lt;_locale_&gt;]].[[co]] must be *null*.</li>
<li>The values *"standard"* and *"search"* must not be used as elements in any [[SortLocaleData]].[[&lt;_locale_&gt;]].[[co]] and [[SearchLocaleData]].[[&lt;_locale_&gt;]].[[co]] list.</li>
<li>[[SearchLocaleData]].[[&lt;_locale_&gt;]] must have a [[sensitivity]] field with a String value equal to *"base"*, *"accent"*, *"case"*, or *"variant"*.</li>
<li>[[SearchLocaleData]].[[&lt;_locale_&gt;]] and [[SortLocaleData]].[[&lt;_locale_&gt;]] must have a [[ignorePunctuation]] field with a Boolean value.</li>
FrankYFTang marked this conversation as resolved.
Show resolved Hide resolved
</ul>
</emu-clause>
</emu-clause>
Expand Down