@kenjura/ursa 0.90.0 → 0.93.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.
@@ -1,46 +0,0 @@
1
- document.addEventListener('DOMContentLoaded', () => {
2
- const article = document.querySelector('article#main-content');
3
- if (!article) return;
4
-
5
- const children = Array.from(article.children);
6
- let sections = [];
7
- let currentSection = document.createElement('section');
8
- currentSection.classList.add('sectionOuter');
9
-
10
- for (let i = 0; i < children.length; i++) {
11
- const el = children[i];
12
- // Skip breadcrumb nav — it stays outside sections
13
- if (el.classList && el.classList.contains('breadcrumbs')) continue;
14
- if (el.tagName === 'H1' && currentSection.childNodes.length > 0) {
15
- sections.push(currentSection);
16
- currentSection = document.createElement('section');
17
- currentSection.classList.add('sectionOuter');
18
- }
19
- currentSection.appendChild(el);
20
- }
21
- if (currentSection.childNodes.length > 0) {
22
- sections.push(currentSection);
23
- }
24
-
25
- // Preserve breadcrumb nav before clearing
26
- const breadcrumbs = article.querySelector('.breadcrumbs');
27
-
28
- // Remove all existing children
29
- while (article.firstChild) {
30
- article.removeChild(article.firstChild);
31
- }
32
-
33
- // Re-insert breadcrumbs at the top, outside any section
34
- if (breadcrumbs) {
35
- article.appendChild(breadcrumbs);
36
- }
37
-
38
- // Append new sections
39
- sections.forEach(section => article.appendChild(section));
40
-
41
-
42
- // Optional: Add section numbers or other decorations
43
- Array.from(article.querySelectorAll('section.sectionOuter')).forEach((section, index) => {
44
- section.style.setProperty('--section-index', index + 1);
45
- });
46
- });