@@ -11,7 +11,7 @@ descendants of the context element.
1111
1212For example, consider querying for ` a > b ~ c ` within this tree:
1313
14- ``` html
14+ ```
1515<a>
1616 <b></b>
1717 <x></x>
@@ -27,17 +27,15 @@ For example, consider querying for `a > b ~ c` within this tree:
2727First, all elements in the root are tested against the final compound selector
2828(` c ` ) to create the initial set of cursors:
2929
30- ``` html
30+ ```
3131<a>
3232 <b></b>
3333 <x></x>
34- <c id =" c_1" ></c >
35- <!-- cursor 1: target=#c_1 -->
34+ <c id="c_1"></c> <!-- cursor 1: target=#c_1 -->
3635 <d>
3736 <x></x>
3837 <b></b>
39- <c id =" c_2" ></c >
40- <!-- cursor 2: target=#c_2 -->
38+ <c id="c_2"></c> <!-- cursor 2: target=#c_2 -->
4139 </d>
4240</a>
4341```
@@ -50,21 +48,15 @@ Moving backwards, the next combinator and compound selector in `a > b ~ c` are
5048` ~ ` and ` b ` , so the next set of candidate elements are the preceding siblings of
5149the current cursors' ` position ` elements:
5250
53- ``` html
51+ ```
5452<a>
55- <b ></b >
56- <!-- candidate for cursor 1 -->
57- <x ></x >
58- <!-- candidate for cursor 1 -->
59- <c id =" c_1" ></c >
60- <!-- cursor 1: target=#c_1 -->
53+ <b></b> <!-- candidate for cursor 1 -->
54+ <x></x> <!-- candidate for cursor 1 -->
55+ <c id="c_1"></c> <!-- cursor 1: target=#c_1 -->
6156 <d>
62- <x ></x >
63- <!-- candidate for cursor 2 -->
64- <b ></b >
65- <!-- candidate for cursor 2 -->
66- <c id =" c_2" ></c >
67- <!-- cursor 2: target=#c_2 -->
57+ <x></x> <!-- candidate for cursor 2 -->
58+ <b></b> <!-- candidate for cursor 2 -->
59+ <c id="c_2"></c> <!-- cursor 2: target=#c_2 -->
6860 </d>
6961</a>
7062```
@@ -74,16 +66,14 @@ elements become the `position`s of the new set of cursors, with their `target`
7466set to the same ` target ` as the cursor for which they were previously a
7567candidate:
7668
77- ``` html
69+ ```
7870<a>
79- <b ></b >
80- <!-- cursor 3: target=#c_1 -->
71+ <b></b> <!-- cursor 3: target=#c_1 -->
8172 <x></x>
8273 <c id="c_1"></c>
8374 <d>
8475 <x></x>
85- <b ></b >
86- <!-- cursor 4: target=#c_2 -->
76+ <b></b> <!-- cursor 4: target=#c_2 -->
8777 <c id="c_2"></c>
8878 </d>
8979</a>
@@ -92,18 +82,14 @@ candidate:
9282The process repeats again for the next combinator and compound selector: ` > ` and
9383` a ` . First, the combinator (` > ` ) determines the candidates:
9484
95- ``` html
96- <a >
97- <!-- candidate for cursor 3 -->
98- <b ></b >
99- <!-- cursor 3: target=#c_1 -->
85+ ```
86+ <a> <!-- candidate for cursor 3 -->
87+ <b></b> <!-- cursor 3: target=#c_1 -->
10088 <x></x>
10189 <c id="c_1"></c>
102- <d >
103- <!-- candidate for cursor 4 -->
90+ <d> <!-- candidate for cursor 4 -->
10491 <x></x>
105- <b ></b >
106- <!-- cursor 4: target=#c_2 -->
92+ <b></b> <!-- cursor 4: target=#c_2 -->
10793 <c id="c_2"></c>
10894 </d>
10995</a>
@@ -112,9 +98,8 @@ The process repeats again for the next combinator and compound selector: `>` and
11298Then, the candidates are filtered by matching against the compound selector
11399(` a ` ), which determines the new cursors:
114100
115- ``` html
116- <a >
117- <!-- cursor 5: target=#c_1 -->
101+ ```
102+ <a> <!-- cursor 5: target=#c_1 -->
118103 <b></b>
119104 <x></x>
120105 <c id="c_1"></c>
0 commit comments