You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/glossary/label-in-name-algorithm.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -20,18 +20,20 @@ Sub-algorithm to tokenize a string:
20
20
- For b) Use the Unicode classes Letter, Mark, and "Number, Decimal Digit [Nd]". (This will exclude hyphens, punctuation, emoji, and more.)
21
21
- Remove all characters that are within parentheses (AKA round brackets).
22
22
- Ignore square brackets and braces.
23
-
- Split the string into a list of strings, using a whitespace regular expression as the separator.
23
+
- Split the string into a list of strings, using a greedy [whitespace][] regular expression as the separator.
24
24
- This 'split' operation must:
25
-
- Effectively remove leading and trailing whitespace as a pre-processing step.
26
-
- If the string was all whitespace before this operation: result in an empty list.
25
+
- Effectively remove leading and trailing [whitespace][].
26
+
- If the input string contains nothing but [whitespace][] before this operation: return an empty list.
27
+
- A consequence of using the ACT definition of [whitespace][] here is that all kinds of whitespace are covered. That includes the Unicode code point U+00A0 - the "No-Break Space" - which can be represented by the HTML named character reference ` `.
27
28
28
29
Then do the check: is the tokenized 'label' a sublist of the tokenized 'name'?
29
30
- This 'sublist' check has these properties:
30
-
- It checks whether elements are consecutive or not. i.e. it checks for a substring, in the computer science sense of the term. Not a subsequence.
31
+
- It checks whether elements are consecutive or not. That is: it checks for a substring, in the computer science sense of the term. Not a subsequence.
31
32
- An empty list is a sublist of any list.
32
33
33
34
If the answer is "yes" (that is: the tokenized 'label' is a sublist of the tokenized 'name'), then this algorithm returns "is contained". Otherwise, it returns "is not contained".
34
35
35
36
[accessible name]: #accessible-name'Definition of accessible name'
37
+
[element]: https://dom.spec.whatwg.org/#element
36
38
[visible inner text]: #visible-inner-text'Definition of Visible inner text'
37
-
[element]: https://dom.spec.whatwg.org/#element
39
+
[whitespace][]: #whitespace 'Definition of whitespace'
0 commit comments