96
}
97
98
function normalizeTreeIdForTesting(id) {
99
- const result = id.match(/:(R|r)([a-z0-9]*)(H([0-9]*))?:/);
99
+ const result = id.match(/\u00AB(R|r)([a-z0-9]*)(H([0-9]*))?\u00BB/);
100
if (result === undefined) {
101
throw new Error('Invalid id format');
102
}
285
// 'R:' prefix, and the first character after that, which may not correspond
286
// to a complete set of 5 bits.
287
//
288
- // Example: :Rclalalalalalalala...:
288
+ // Example: «Rclalalalalalalala...:
289
//
290
// We can use this pattern to test large ids that exceed the bitwise
291
// safe range (32 bits). The algorithm should theoretically support ids
320
321
// Confirm that every id matches the expected pattern
322
for (let i = 0; i < divs.length; i++) {
323
- // Example: :Rclalalalalalalala...:
324
- expect(divs[i].id).toMatch(/^:R.(((al)*a?)((la)*l?))*:$/);
323
+ // Example: «Rclalalalalalalala...:
324
+ expect(divs[i].id).toMatch(/^\u00ABR.(((al)*a?)((la)*l?))*\u00BB$/);
325
}
326
});
327
345
<div
346
id="container"
347
>
348
- :R0:, :R0H1:, :R0H2:
348
+ «R0», «R0H1», «R0H2»
349
</div>
350
`);
351
});
370
<div
371
id="container"
372
>
373
- :R0:
373
+ «R0»
374
</div>
375
`);
376
});
608
id="container"
609
>
610
<div>
611
- :custom-prefix-R1:
611
+ «custom-prefix-R1»
612
</div>
613
<div>
614
- :custom-prefix-R2:
614
+ «custom-prefix-R2»
615
</div>
616
</div>
617
`);
625
id="container"
626
>
627
<div>
628
- :custom-prefix-R1:
628
+ «custom-prefix-R1»
629
</div>
630
<div>
631
- :custom-prefix-R2:
631
+ «custom-prefix-R2»
632
</div>
633
<div>
634
- :custom-prefix-r0:
634
+ «custom-prefix-r0»
635
</div>
636
</div>
637
`);
672
id="container"
673
>
674
<div>
675
- :R0:
675
+ «R0»
676
<!-- -->
677
678
<div>
679
- :R7:
679
+ «R7»
680
</div>
681
</div>
682
</div>
690
id="container"
691
>
692
<div>
693
- :R0:
693
+ «R0»
694
<!-- -->
695
696
<div>
697
- :R7:
697
+ «R7»
698
</div>
699
</div>
700
</div>