securemark 0.265.0 → 0.266.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,7 +52,7 @@ describe('Unit: parser/processor/figure', () => {
52
52
  [...target.children].map(el => el.outerHTML),
53
53
  [
54
54
  '<figure data-type="quote" data-label="test-a" data-group="test" data-number="1" id="label:test-a"><figcaption><span class="figindex">Test 1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
55
- '<h2 id="index:0">0</h2>',
55
+ '<h2 id="index::0">0</h2>',
56
56
  '<figure data-type="quote" data-label="test-b" data-group="test" data-number="2" id="label:test-b"><figcaption><span class="figindex">Test 2. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
57
57
  '<figure data-type="quote" data-label="quote-a" data-group="quote" data-number="1" id="label:quote-a"><figcaption><span class="figindex">Quote 1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
58
58
  '<figure data-type="quote" data-label="test-b" data-group="test" data-number="3" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Duplicate label"><figcaption><span class="figindex">Test 3. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
@@ -168,40 +168,40 @@ describe('Unit: parser/processor/figure', () => {
168
168
  assert.deepStrictEqual(
169
169
  [...target.children].map(el => normalize(el.outerHTML)),
170
170
  [
171
- '<h1 id="index:0">0</h1>',
171
+ '<h1 id="index::0">0</h1>',
172
172
  '<figure data-label="$-0.0" data-group="$" hidden="" data-number="0.0"></figure>',
173
- '<h2 id="index:0">0</h2>',
173
+ '<h2 id="index::0">0</h2>',
174
174
  '<figure data-type="quote" data-label="test-1" data-group="test" data-number="1" id="label:test-1"><figcaption><span class="figindex">Test 1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
175
- '<h2 id="index:0">0</h2>',
175
+ '<h2 id="index::0">0</h2>',
176
176
  '<blockquote><section><h2>0</h2><h2>References</h2><ol class="references"></ol></section></blockquote>',
177
177
  '<figure data-type="quote" data-label="test-b" data-group="test" data-number="2.1" id="label:test-b"><figcaption><span class="figindex">Test 2.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
178
- '<h2 id="index:0">0</h2>',
178
+ '<h2 id="index::0">0</h2>',
179
179
  '<figure data-label="$-0.0.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Base index must be $-x.0 format"></figure>',
180
- '<h3 id="index:0">0</h3>',
180
+ '<h3 id="index::0">0</h3>',
181
181
  '<figure data-label="$-0.0" data-group="$" hidden="" data-number="3.0"></figure>',
182
182
  '<figure data-type="quote" data-label="test-c" data-group="test" data-number="3.1" id="label:test-c"><figcaption><span class="figindex">Test 3.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
183
- '<h2 id="index:0">0</h2>',
183
+ '<h2 id="index::0">0</h2>',
184
184
  '<figure data-label="$-0.1.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Base index must be $-x.0 format"></figure>',
185
185
  '<figure data-type="quote" data-label="test-d" data-group="test" data-number="4.1" id="label:test-d"><figcaption><span class="figindex">Test 4.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
186
186
  '<figure data-label="$-0.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="position" data-invalid-message="Base index declarations must be after level 1 to 6 headings"></figure>',
187
187
  '<figure data-label="$-0.1.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Base index must be $-x.0 format"></figure>',
188
188
  '<figure data-label="$-0.4.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Base index must be $-x.0 format"></figure>',
189
189
  '<figure data-label="$-0.1.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Base index must be $-x.0 format"></figure>',
190
- '<h2 id="index:0">0</h2>',
191
- '<h2 id="index:0">0</h2>',
190
+ '<h2 id="index::0">0</h2>',
191
+ '<h2 id="index::0">0</h2>',
192
192
  '<figure data-label="$-0.0" data-group="$" hidden="" data-number="6.0"></figure>',
193
193
  '<figure data-type="quote" data-label="test-e" data-group="test" data-number="6.1" id="label:test-e"><figcaption><span class="figindex">Test 6.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
194
- '<h2 id="index:0">0</h2>',
194
+ '<h2 id="index::0">0</h2>',
195
195
  '<figure data-label="$-5.0" data-group="$" hidden="" data-number="5.0"></figure>',
196
196
  '<figure data-type="quote" data-label="test-f" data-group="test" data-number="5.1" id="label:test-f"><figcaption><span class="figindex">Test 5.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
197
197
  '<figure data-label="$-0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Invalid base index"></figure>',
198
198
  '<figure data-type="quote" data-label="test-g" data-group="test" data-number="5.2" id="label:test-g"><figcaption><span class="figindex">Test 5.2. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
199
- '<h3 id="index:0">0</h3>',
199
+ '<h3 id="index::0">0</h3>',
200
200
  '<figure data-label="$-0.0.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="argument" data-invalid-message="Base index must be $-x.0 format"></figure>',
201
201
  '<figure data-type="quote" data-label="test-h" data-group="test" data-number="5.3" id="label:test-h"><figcaption><span class="figindex">Test 5.3. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
202
- '<h3 id="index:0">0</h3>',
202
+ '<h3 id="index::0">0</h3>',
203
203
  '<figure data-type="quote" data-label="test-i" data-group="test" data-number="5.4" id="label:test-i"><figcaption><span class="figindex">Test 5.4. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
204
- '<h1 id="index:0">0</h1>',
204
+ '<h1 id="index::0">0</h1>',
205
205
  '<figure data-type="quote" data-label="test-j" data-group="test" data-number="6.1" id="label:test-j"><figcaption><span class="figindex">Test 6.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
206
206
  ]);
207
207
  }
@@ -235,22 +235,22 @@ describe('Unit: parser/processor/figure', () => {
235
235
  [...target.children].map(el => normalize(el.outerHTML)),
236
236
  [
237
237
  '<figure data-label="$-0.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="position" data-invalid-message="Base index declarations must be after level 1 to 6 headings"></figure>',
238
- '<h2 id="index:0">0</h2>',
238
+ '<h2 id="index::0">0</h2>',
239
239
  '<figure data-label="$-0.0" data-group="$" hidden="" data-number="0.0"></figure>',
240
240
  '<figure data-type="quote" data-label="test-a" data-group="test" data-number="0.1" id="label:test-a"><figcaption><span class="figindex">Test 0.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
241
241
  '<figure data-label="$-0.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="position" data-invalid-message="Base index declarations must be after level 1 to 6 headings"></figure>',
242
- '<h2 id="index:0">0</h2>',
242
+ '<h2 id="index::0">0</h2>',
243
243
  '<figure data-type="quote" data-label="test-b" data-group="test" data-number="1.1" id="label:test-b"><figcaption><span class="figindex">Test 1.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
244
244
  '<figure data-label="$-0.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="position" data-invalid-message="Base index declarations must be after level 1 to 6 headings"></figure>',
245
- '<h3 id="index:0">0</h3>',
245
+ '<h3 id="index::0">0</h3>',
246
246
  '<figure data-type="quote" data-label="test-c" data-group="test" data-number="1.2" id="label:test-c"><figcaption><span class="figindex">Test 1.2. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
247
247
  '<figure data-label="$-1.0" data-group="$" class="invalid" data-invalid-syntax="figure" data-invalid-type="position" data-invalid-message="Base index declarations must be after level 1 to 6 headings"></figure>',
248
- '<h2 id="index:0">0</h2>',
248
+ '<h2 id="index::0">0</h2>',
249
249
  '<figure data-label="$-0.0" data-group="$" hidden="" data-number="2.0"></figure>',
250
250
  '<figure data-type="quote" data-label="test-d" data-group="test" data-number="2.1" id="label:test-d"><figcaption><span class="figindex">Test 2.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
251
- '<h3 id="index:0">0</h3>',
251
+ '<h3 id="index::0">0</h3>',
252
252
  '<figure data-label="$-0.0" data-group="$" hidden="" data-number="2.0"></figure>',
253
- '<h2 id="index:0">0</h2>',
253
+ '<h2 id="index::0">0</h2>',
254
254
  '<figure data-label="$-9.0" data-group="$" hidden="" data-number="9.0"></figure>',
255
255
  '<figure data-type="quote" data-label="test-e" data-group="test" data-number="9.1" id="label:test-e"><figcaption><span class="figindex">Test 9.1. </span><span class="figtext"></span></figcaption><div><blockquote></blockquote></div></figure>',
256
256
  ]);
@@ -27,18 +27,18 @@ describe('Unit: parser/processor/footnote', () => {
27
27
  [...target.children].map(el => el.outerHTML),
28
28
  [
29
29
  html('p', [
30
- html('sup', { class: "annotation", id: "annotation:ref:1", title: "a b" }, [
30
+ html('sup', { class: "annotation", id: "annotation::ref:1", title: "a b" }, [
31
31
  html('span', { hidden: '' }, 'a b'),
32
- html('a', { href: "#annotation:def:1" }, '*1')
32
+ html('a', { href: "#annotation::def:1" }, '*1')
33
33
  ]),
34
34
  ]).outerHTML,
35
35
  ]);
36
36
  assert.deepStrictEqual(
37
37
  footnote.outerHTML,
38
38
  html('ol', [
39
- html('li', { id: 'annotation:def:1' }, [
39
+ html('li', { id: 'annotation::def:1' }, [
40
40
  'a b',
41
- html('sup', [html('a', { href: '#annotation:ref:1' }, '^1')])
41
+ html('sup', [html('a', { href: '#annotation::ref:1' }, '^1')])
42
42
  ]),
43
43
  ]).outerHTML);
44
44
  }
@@ -53,26 +53,26 @@ describe('Unit: parser/processor/footnote', () => {
53
53
  [...target.children].map(el => el.outerHTML),
54
54
  [
55
55
  html('p', [
56
- html('sup', { class: "annotation", id: "annotation:ref:1", title: "1" }, [
56
+ html('sup', { class: "annotation", id: "annotation::ref:1", title: "1" }, [
57
57
  html('span', { hidden: '' }, '1'),
58
- html('a', { href: "#annotation:def:1" }, '*1')
58
+ html('a', { href: "#annotation::def:1" }, '*1')
59
59
  ]),
60
- html('sup', { class: "annotation", id: "annotation:ref:2", title: "12345678901234567890" }, [
60
+ html('sup', { class: "annotation", id: "annotation::ref:2", title: "12345678901234567890" }, [
61
61
  html('span', { hidden: '' }, '12345678901234567890'),
62
- html('a', { href: "#annotation:def:2" }, '*2')
62
+ html('a', { href: "#annotation::def:2" }, '*2')
63
63
  ]),
64
64
  ]).outerHTML,
65
65
  ]);
66
66
  assert.deepStrictEqual(
67
67
  footnote.outerHTML,
68
68
  html('ol', [
69
- html('li', { id: 'annotation:def:1' }, [
69
+ html('li', { id: 'annotation::def:1' }, [
70
70
  '1',
71
- html('sup', [html('a', { href: '#annotation:ref:1' }, '^1')])
71
+ html('sup', [html('a', { href: '#annotation::ref:1' }, '^1')])
72
72
  ]),
73
- html('li', { id: 'annotation:def:2' }, [
73
+ html('li', { id: 'annotation::def:2' }, [
74
74
  '12345678901234567890',
75
- html('sup', [html('a', { href: '#annotation:ref:2' }, '^2')])
75
+ html('sup', [html('a', { href: '#annotation::ref:2' }, '^2')])
76
76
  ]),
77
77
  ]).outerHTML);
78
78
  }
@@ -87,49 +87,49 @@ describe('Unit: parser/processor/footnote', () => {
87
87
  [...target.children].map(el => el.outerHTML),
88
88
  [
89
89
  html('p', [
90
- html('sup', { class: "annotation", id: "annotation:ref:1", title: "1" }, [
90
+ html('sup', { class: "annotation", id: "annotation::ref:1", title: "1" }, [
91
91
  html('span', { hidden: '' }, '1'),
92
- html('a', { href: "#annotation:def:1" }, '*1')
92
+ html('a', { href: "#annotation::def:1" }, '*1')
93
93
  ]),
94
- html('sup', { class: "annotation", id: "annotation:ref:2", title: "2" }, [
94
+ html('sup', { class: "annotation", id: "annotation::ref:2", title: "2" }, [
95
95
  html('span', { hidden: '' }, '2'),
96
- html('a', { href: "#annotation:def:2" }, '*2')
96
+ html('a', { href: "#annotation::def:2" }, '*2')
97
97
  ]),
98
- html('sup', { class: "annotation", id: "annotation:ref:3", title: "3" }, [
98
+ html('sup', { class: "annotation", id: "annotation::ref:3", title: "3" }, [
99
99
  html('span', { hidden: '' }, '3'),
100
- html('a', { href: "#annotation:def:3" }, '*3')
100
+ html('a', { href: "#annotation::def:3" }, '*3')
101
101
  ]),
102
- html('sup', { class: "annotation", id: "annotation:ref:4", title: "2" }, [
102
+ html('sup', { class: "annotation", id: "annotation::ref:4", title: "2" }, [
103
103
  html('span', { hidden: '' }, '2'),
104
- html('a', { href: "#annotation:def:2" }, '*2')
104
+ html('a', { href: "#annotation::def:2" }, '*2')
105
105
  ]),
106
- html('sup', { class: "annotation", id: "annotation:ref:5", title: "4" }, [
106
+ html('sup', { class: "annotation", id: "annotation::ref:5", title: "4" }, [
107
107
  html('span', { hidden: '' }, '4'),
108
- html('a', { href: "#annotation:def:4" }, '*4')
108
+ html('a', { href: "#annotation::def:4" }, '*4')
109
109
  ]),
110
110
  ]).outerHTML,
111
111
  ]);
112
112
  assert.deepStrictEqual(
113
113
  footnote.outerHTML,
114
114
  html('ol', [
115
- html('li', { id: 'annotation:def:1' }, [
115
+ html('li', { id: 'annotation::def:1' }, [
116
116
  '1',
117
- html('sup', [html('a', { href: '#annotation:ref:1' }, '^1')])
117
+ html('sup', [html('a', { href: '#annotation::ref:1' }, '^1')])
118
118
  ]),
119
- html('li', { id: 'annotation:def:2' }, [
119
+ html('li', { id: 'annotation::def:2' }, [
120
120
  '2',
121
121
  html('sup', [
122
- html('a', { href: '#annotation:ref:2' }, '^2'),
123
- html('a', { href: '#annotation:ref:4' }, '^4'),
122
+ html('a', { href: '#annotation::ref:2' }, '^2'),
123
+ html('a', { href: '#annotation::ref:4' }, '^4'),
124
124
  ]),
125
125
  ]),
126
- html('li', { id: 'annotation:def:3' }, [
126
+ html('li', { id: 'annotation::def:3' }, [
127
127
  '3',
128
- html('sup', [html('a', { href: '#annotation:ref:3' }, '^3')])
128
+ html('sup', [html('a', { href: '#annotation::ref:3' }, '^3')])
129
129
  ]),
130
- html('li', { id: 'annotation:def:4' }, [
130
+ html('li', { id: 'annotation::def:4' }, [
131
131
  '4',
132
- html('sup', [html('a', { href: '#annotation:ref:5' }, '^5')])
132
+ html('sup', [html('a', { href: '#annotation::ref:5' }, '^5')])
133
133
  ]),
134
134
  ]).outerHTML);
135
135
  }
@@ -153,11 +153,11 @@ describe('Unit: parser/processor/footnote', () => {
153
153
  [
154
154
  '<blockquote><blockquote><section><p><sup class="annotation disabled" title="a"><span hidden="">a</span><a>*1</a></sup></p><ol class="annotations"><li data-marker="*1">a<sup><a>^1</a></sup></li></ol><h2>References</h2><ol class="references"></ol></section></blockquote><section><p><sup class="annotation disabled" title="a"><span hidden="">a</span><a>*1</a></sup><br>~~~</p><ol class="annotations"><li data-marker="*1">a<sup><a>^1</a></sup></li></ol><h2>References</h2><ol class="references"></ol></section></blockquote>',
155
155
  '<aside class="example" data-type="markdown"><pre translate="no">((a))</pre><hr><section><p><sup class="annotation disabled" title="a"><span hidden="">a</span><a>*1</a></sup></p><ol class="annotations"><li data-marker="*1">a<sup><a>^1</a></sup></li></ol><h2>References</h2><ol class="references"></ol></section></aside>',
156
- '<p><sup class="annotation" id="annotation:ref:1" title="a"><span hidden="">a</span><a href="#annotation:def:1">*1</a></sup></p>',
156
+ '<p><sup class="annotation" id="annotation::ref:1" title="a"><span hidden="">a</span><a href="#annotation::def:1">*1</a></sup></p>',
157
157
  ]);
158
158
  assert.deepStrictEqual(
159
159
  footnote.outerHTML,
160
- '<ol><li id="annotation:def:1">a<sup><a href="#annotation:ref:1">^1</a></sup></li></ol>');
160
+ '<ol><li id="annotation::def:1">a<sup><a href="#annotation::ref:1">^1</a></sup></li></ol>');
161
161
  }
162
162
  });
163
163
 
@@ -195,50 +195,50 @@ describe('Unit: parser/processor/footnote', () => {
195
195
  [...target.children].map(el => el.outerHTML),
196
196
  [
197
197
  html('p', [
198
- html('sup', { class: "annotation", id: "annotation:ref:1", title: "1" }, [
198
+ html('sup', { class: "annotation", id: "annotation::ref:1", title: "1" }, [
199
199
  html('span', { hidden: '' }, '1'),
200
- html('a', { href: "#annotation:def:1" }, '*1')
200
+ html('a', { href: "#annotation::def:1" }, '*1')
201
201
  ]),
202
202
  ]).outerHTML,
203
203
  html('ol', { class: 'annotations' }, [
204
- html('li', { id: 'annotation:def:1', 'data-marker': '*1' }, [
204
+ html('li', { id: 'annotation::def:1', 'data-marker': '*1' }, [
205
205
  '1',
206
- html('sup', [html('a', { href: '#annotation:ref:1' }, '^1')])
206
+ html('sup', [html('a', { href: '#annotation::ref:1' }, '^1')])
207
207
  ]),
208
208
  ]).outerHTML,
209
- html('h2', { id: 'index:a' }, 'a').outerHTML,
210
- html('h2', { id: 'index:b' }, 'b').outerHTML,
209
+ html('h2', { id: 'index::a' }, 'a').outerHTML,
210
+ html('h2', { id: 'index::b' }, 'b').outerHTML,
211
211
  html('p', [
212
- html('sup', { class: "annotation", id: "annotation:ref:2", title: "2" }, [
212
+ html('sup', { class: "annotation", id: "annotation::ref:2", title: "2" }, [
213
213
  html('span', { hidden: '' }, '2'),
214
- html('a', { href: "#annotation:def:2" }, '*2')
214
+ html('a', { href: "#annotation::def:2" }, '*2')
215
215
  ]),
216
- html('sup', { class: "annotation", id: "annotation:ref:3", title: "3" }, [
216
+ html('sup', { class: "annotation", id: "annotation::ref:3", title: "3" }, [
217
217
  html('span', { hidden: '' }, '3'),
218
- html('a', { href: "#annotation:def:3" }, '*3')
218
+ html('a', { href: "#annotation::def:3" }, '*3')
219
219
  ]),
220
220
  ]).outerHTML,
221
221
  html('ol', { class: 'annotations' }, [
222
- html('li', { id: 'annotation:def:2', 'data-marker': '*2' }, [
222
+ html('li', { id: 'annotation::def:2', 'data-marker': '*2' }, [
223
223
  '2',
224
- html('sup', [html('a', { href: '#annotation:ref:2' }, '^2')])
224
+ html('sup', [html('a', { href: '#annotation::ref:2' }, '^2')])
225
225
  ]),
226
- html('li', { id: 'annotation:def:3', 'data-marker': '*3' }, [
226
+ html('li', { id: 'annotation::def:3', 'data-marker': '*3' }, [
227
227
  '3',
228
- html('sup', [html('a', { href: '#annotation:ref:3' }, '^3')])
228
+ html('sup', [html('a', { href: '#annotation::ref:3' }, '^3')])
229
229
  ]),
230
230
  ]).outerHTML,
231
- html('h2', { id: 'index:c' }, 'c').outerHTML,
231
+ html('h2', { id: 'index::c' }, 'c').outerHTML,
232
232
  html('p', [
233
- html('sup', { class: "annotation", id: "annotation:ref:4", title: "4" }, [
233
+ html('sup', { class: "annotation", id: "annotation::ref:4", title: "4" }, [
234
234
  html('span', { hidden: '' }, '4'),
235
- html('a', { href: "#annotation:def:4" }, '*4')
235
+ html('a', { href: "#annotation::def:4" }, '*4')
236
236
  ]),
237
237
  ]).outerHTML,
238
238
  html('ol', { class: 'annotations' }, [
239
- html('li', { id: 'annotation:def:4', 'data-marker': '*4' }, [
239
+ html('li', { id: 'annotation::def:4', 'data-marker': '*4' }, [
240
240
  '4',
241
- html('sup', [html('a', { href: '#annotation:ref:4' }, '^4')])
241
+ html('sup', [html('a', { href: '#annotation::ref:4' }, '^4')])
242
242
  ]),
243
243
  ]).outerHTML,
244
244
  ]);
@@ -257,18 +257,18 @@ describe('Unit: parser/processor/footnote', () => {
257
257
  [...target.children].map(el => el.outerHTML),
258
258
  [
259
259
  html('p', [
260
- html('sup', { class: "reference", id: "reference:ref:1", title: "a b" }, [
260
+ html('sup', { class: "reference", id: "reference::ref:1", title: "a b" }, [
261
261
  html('span', { hidden: '' }, 'a b'),
262
- html('a', { href: "#reference:def:1" }, '[1]')
262
+ html('a', { href: "#reference::def:1" }, '[1]')
263
263
  ]),
264
264
  ]).outerHTML,
265
265
  ]);
266
266
  assert.deepStrictEqual(
267
267
  footnote.outerHTML,
268
268
  html('ol', [
269
- html('li', { id: 'reference:def:1' }, [
269
+ html('li', { id: 'reference::def:1' }, [
270
270
  'a b',
271
- html('sup', [html('a', { href: '#reference:ref:1' }, '^1')])
271
+ html('sup', [html('a', { href: '#reference::ref:1' }, '^1')])
272
272
  ]),
273
273
  ]).outerHTML);
274
274
  }
@@ -283,29 +283,29 @@ describe('Unit: parser/processor/footnote', () => {
283
283
  [...target.children].map(el => el.outerHTML),
284
284
  [
285
285
  html('p', [
286
- html('sup', { class: "reference", 'data-abbr': "a", id: "reference:ref:1", title: "b" }, [
286
+ html('sup', { class: "reference", 'data-abbr': "a", id: "reference::ref:1", title: "b" }, [
287
287
  html('span', { hidden: '' }),
288
- html('a', { href: "#reference:def:1" }, '[a]')
288
+ html('a', { href: "#reference::def:1" }, '[a]')
289
289
  ]),
290
- html('sup', { class: "reference", 'data-abbr': "a", id: "reference:ref:2", title: "b" }, [
290
+ html('sup', { class: "reference", 'data-abbr': "a", id: "reference::ref:2", title: "b" }, [
291
291
  html('span', { hidden: '' }, 'b'),
292
- html('a', { href: "#reference:def:1" }, '[a]')
292
+ html('a', { href: "#reference::def:1" }, '[a]')
293
293
  ]),
294
- html('sup', { class: "reference", 'data-abbr': "a", id: "reference:ref:3", title: "b" }, [
294
+ html('sup', { class: "reference", 'data-abbr': "a", id: "reference::ref:3", title: "b" }, [
295
295
  html('span', { hidden: '' }),
296
- html('a', { href: "#reference:def:1" }, '[a]')
296
+ html('a', { href: "#reference::def:1" }, '[a]')
297
297
  ]),
298
298
  ]).outerHTML,
299
299
  ]);
300
300
  assert.deepStrictEqual(
301
301
  footnote.outerHTML,
302
302
  html('ol', [
303
- html('li', { id: 'reference:def:1' }, [
303
+ html('li', { id: 'reference::def:1' }, [
304
304
  'b',
305
305
  html('sup', [
306
- html('a', { href: '#reference:ref:1' }, '^1'),
307
- html('a', { href: '#reference:ref:2', title: 'b' }, '^2'),
308
- html('a', { href: '#reference:ref:3' }, '^3'),
306
+ html('a', { href: '#reference::ref:1' }, '^1'),
307
+ html('a', { href: '#reference::ref:2', title: 'b' }, '^2'),
308
+ html('a', { href: '#reference::ref:3' }, '^3'),
309
309
  ])
310
310
  ]),
311
311
  ]).outerHTML);
@@ -52,14 +52,18 @@ function build(
52
52
  len = refs.length, i = 0; i < len; ++i) {
53
53
  yield;
54
54
  const ref = refs[i];
55
- while (+splitters[0]?.compareDocumentPosition(ref) & Node.DOCUMENT_POSITION_FOLLOWING) {
55
+ while (splitters.length > 0
56
+ && splitters[0].compareDocumentPosition(ref) & Node.DOCUMENT_POSITION_FOLLOWING) {
56
57
  if (defs.size > 0) {
57
58
  total += defs.size;
58
- yield* proc(defs, target.insertBefore(html('ol', { class: `${syntax}s` }), splitters[0] ?? null));
59
+ yield* proc(defs, target.insertBefore(html('ol', { class: `${syntax}s` }), splitters[0]));
60
+ }
61
+ else if (splitters.length % 100 === 0) {
62
+ yield;
59
63
  }
60
64
  splitters.shift();
61
65
  }
62
- const identifier = `${+!ref.querySelector('.label')}:${ref.getAttribute('data-abbr') || '_' + ref.firstElementChild!.innerHTML}`;
66
+ const identifier = ref.getAttribute('data-abbr') || ` ${ref.firstElementChild!.innerHTML}`;
63
67
  const abbr = ref.getAttribute('data-abbr') || undefined;
64
68
  const content = frag(ref.firstElementChild!.cloneNode(true).childNodes);
65
69
  style ??= abbr ? 'abbr' : 'count';
@@ -85,12 +89,8 @@ function build(
85
89
  else {
86
90
  ref.lastChild?.remove();
87
91
  }
88
- const title = undefined
89
- || titles.get(identifier)
90
- || +identifier[0] && ref.title
91
- || text(content).trim()
92
- || content.textContent!.trim()
93
- || undefined;
92
+ const title = titles.get(identifier) || text(content).trim() || undefined;
93
+ assert(title !== '');
94
94
  assert(syntax !== 'annotation' || title);
95
95
  title
96
96
  ? !titles.has(identifier) && titles.set(identifier, title)
@@ -99,13 +99,13 @@ function build(
99
99
  const blank = !!abbr && !content.firstChild;
100
100
  const refIndex = ++count;
101
101
  const refId = opts.id !== ''
102
- ? ref.id || `${syntax}:${opts.id ? `${opts.id}:` : ''}ref:${refIndex}`
102
+ ? `${syntax}:${opts.id ?? ''}:ref:${refIndex}`
103
103
  : undefined;
104
104
  const def = undefined
105
105
  || defs.get(identifier)
106
106
  || defs.set(identifier, html('li',
107
107
  {
108
- id: opts.id !== '' ? `${syntax}:${opts.id ? `${opts.id}:` : ''}def:${total + defs.size + 1}` : undefined,
108
+ id: opts.id !== '' ? `${syntax}:${opts.id ?? ''}:def:${total + defs.size + 1}` : undefined,
109
109
  'data-marker': !footnote ? marker(total + defs.size + 1, abbr) : undefined,
110
110
  },
111
111
  [content.cloneNode(true), html('sup')]))
@@ -14,7 +14,7 @@ describe('Unit: util/toc', () => {
14
14
  assert.strictEqual(
15
15
  toc(parse('# 1')).outerHTML,
16
16
  html('ul', [
17
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1')]),
17
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1')]),
18
18
  ]).outerHTML);
19
19
  });
20
20
 
@@ -22,7 +22,7 @@ describe('Unit: util/toc', () => {
22
22
  assert.strictEqual(
23
23
  toc(parse('# 1\n\na')).outerHTML,
24
24
  html('ul', [
25
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1')]),
25
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1')]),
26
26
  ]).outerHTML);
27
27
  });
28
28
 
@@ -30,8 +30,8 @@ describe('Unit: util/toc', () => {
30
30
  assert.strictEqual(
31
31
  toc(parse('# 1\n\n# 2')).outerHTML,
32
32
  html('ul', [
33
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1')]),
34
- html('li', [html('a', { href: '#index:2', 'data-index': '2' }, '2')]),
33
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1')]),
34
+ html('li', [html('a', { href: '#index::2', 'data-index': '2' }, '2')]),
35
35
  ]).outerHTML);
36
36
  });
37
37
 
@@ -39,9 +39,9 @@ describe('Unit: util/toc', () => {
39
39
  assert.strictEqual(
40
40
  toc(parse('# 1\n\n## 2')).outerHTML,
41
41
  html('ul', [
42
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1'),
42
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1'),
43
43
  html('ul', [
44
- html('li', [html('a', { href: '#index:2', 'data-index': '1.1' }, '2')]),
44
+ html('li', [html('a', { href: '#index::2', 'data-index': '1.1' }, '2')]),
45
45
  ]),
46
46
  ]),
47
47
  ]).outerHTML);
@@ -51,12 +51,12 @@ describe('Unit: util/toc', () => {
51
51
  assert.strictEqual(
52
52
  toc(parse('# 1\n\n## 2\n\n# 3')).outerHTML,
53
53
  html('ul', [
54
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1'),
54
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1'),
55
55
  html('ul', [
56
- html('li', [html('a', { href: '#index:2', 'data-index': '1.1' }, '2')]),
56
+ html('li', [html('a', { href: '#index::2', 'data-index': '1.1' }, '2')]),
57
57
  ]),
58
58
  ]),
59
- html('li', [html('a', { href: '#index:3', 'data-index': '2' }, '3')]),
59
+ html('li', [html('a', { href: '#index::3', 'data-index': '2' }, '3')]),
60
60
  ]).outerHTML);
61
61
  });
62
62
 
@@ -64,14 +64,14 @@ describe('Unit: util/toc', () => {
64
64
  assert.strictEqual(
65
65
  toc(parse('# 1\n\n## 2\n\n### 3\n\n## 4')).outerHTML,
66
66
  html('ul', [
67
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1'),
67
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1'),
68
68
  html('ul', [
69
- html('li', [html('a', { href: '#index:2', 'data-index': '1.1' }, '2'),
69
+ html('li', [html('a', { href: '#index::2', 'data-index': '1.1' }, '2'),
70
70
  html('ul', [
71
- html('li', [html('a', { href: '#index:3', 'data-index': '1.1.1' }, '3')]),
71
+ html('li', [html('a', { href: '#index::3', 'data-index': '1.1.1' }, '3')]),
72
72
  ]),
73
73
  ]),
74
- html('li', [html('a', { href: '#index:4', 'data-index': '1.2' }, '4')]),
74
+ html('li', [html('a', { href: '#index::4', 'data-index': '1.2' }, '4')]),
75
75
  ]),
76
76
  ]),
77
77
  ]).outerHTML);
@@ -81,16 +81,16 @@ describe('Unit: util/toc', () => {
81
81
  assert.strictEqual(
82
82
  toc(parse('# 1\n\n## 2\n\n### 3\n\n# 4')).outerHTML,
83
83
  html('ul', [
84
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1'),
84
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1'),
85
85
  html('ul', [
86
- html('li', [html('a', { href: '#index:2', 'data-index': '1.1' }, '2'),
86
+ html('li', [html('a', { href: '#index::2', 'data-index': '1.1' }, '2'),
87
87
  html('ul', [
88
- html('li', [html('a', { href: '#index:3', 'data-index': '1.1.1' }, '3')]),
88
+ html('li', [html('a', { href: '#index::3', 'data-index': '1.1.1' }, '3')]),
89
89
  ]),
90
90
  ]),
91
91
  ]),
92
92
  ]),
93
- html('li', [html('a', { href: '#index:4', 'data-index': '2' }, '4')]),
93
+ html('li', [html('a', { href: '#index::4', 'data-index': '2' }, '4')]),
94
94
  ]).outerHTML);
95
95
  });
96
96
 
@@ -98,10 +98,10 @@ describe('Unit: util/toc', () => {
98
98
  assert.strictEqual(
99
99
  toc(parse('# 1\n\n### 2\n\n## 3')).outerHTML,
100
100
  html('ul', [
101
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1'),
101
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1'),
102
102
  html('ul', [
103
- html('li', [html('a', { href: '#index:2', 'data-index': '1.1' }, '2')]),
104
- html('li', [html('a', { href: '#index:3', 'data-index': '1.2' }, '3')]),
103
+ html('li', [html('a', { href: '#index::2', 'data-index': '1.1' }, '2')]),
104
+ html('li', [html('a', { href: '#index::3', 'data-index': '1.2' }, '3')]),
105
105
  ]),
106
106
  ]),
107
107
  ]).outerHTML);
@@ -111,10 +111,10 @@ describe('Unit: util/toc', () => {
111
111
  assert.strictEqual(
112
112
  toc(parse('## 1\n\n# 2\n\n## 3')).outerHTML,
113
113
  html('ul', [
114
- html('li', [html('a', { href: '#index:1', 'data-index': '1' }, '1')]),
115
- html('li', [html('a', { href: '#index:2', 'data-index': '2' }, '2'),
114
+ html('li', [html('a', { href: '#index::1', 'data-index': '1' }, '1')]),
115
+ html('li', [html('a', { href: '#index::2', 'data-index': '2' }, '2'),
116
116
  html('ul', [
117
- html('li', [html('a', { href: '#index:3', 'data-index': '2.1' }, '3')]),
117
+ html('li', [html('a', { href: '#index::3', 'data-index': '2.1' }, '3')]),
118
118
  ]),
119
119
  ]),
120
120
  ]).outerHTML);
@@ -124,12 +124,12 @@ describe('Unit: util/toc', () => {
124
124
  assert.strictEqual(
125
125
  toc(parse('~~~aside\n# 1\n~~~\n\n# 2\n\n## 3\n\n~~~aside\n## 4\n~~~\n\n## 5')).outerHTML,
126
126
  html('ul', [
127
- html('li', [html('a', { href: '#index:1' }, '1')]),
128
- html('li', [html('a', { href: '#index:2', 'data-index': '1' }, '2'),
127
+ html('li', [html('a', { href: '#index::1' }, '1')]),
128
+ html('li', [html('a', { href: '#index::2', 'data-index': '1' }, '2'),
129
129
  html('ul', [
130
- html('li', [html('a', { href: '#index:3', 'data-index': '1.1' }, '3')]),
131
- html('li', [html('a', { href: '#index:4' }, '4')]),
132
- html('li', [html('a', { href: '#index:5', 'data-index': '1.2' }, '5')]),
130
+ html('li', [html('a', { href: '#index::3', 'data-index': '1.1' }, '3')]),
131
+ html('li', [html('a', { href: '#index::4' }, '4')]),
132
+ html('li', [html('a', { href: '#index::5', 'data-index': '1.2' }, '5')]),
133
133
  ]),
134
134
  ]),
135
135
  ]).outerHTML);