|
385 | 385 | font-size: 0.7rem; |
386 | 386 | } |
387 | 387 |
|
388 | | - .content-wrapper ol { |
389 | | - counter-reset: list-counter; |
390 | | - } |
391 | 388 |
|
392 | | - .content-wrapper ol li { |
393 | | - counter-increment: list-counter; |
| 389 | + .content-wrapper ol li::before { |
| 390 | + display: none; |
394 | 391 | } |
395 | 392 |
|
396 | | - .content-wrapper ol li::before { |
397 | | - content: counter(list-counter); |
| 393 | + .content-wrapper .list-badge { |
398 | 394 | position: absolute; |
399 | 395 | left: 0.5rem; |
400 | 396 | top: 50%; |
@@ -13571,6 +13567,7 @@ <h2>Download Other Formats</h2> |
13571 | 13567 | loadPreferences(); |
13572 | 13568 | setupEventListeners(); |
13573 | 13569 | updateActiveNavigation(); |
| 13570 | + injectOrderedListBadges(); |
13574 | 13571 |
|
13575 | 13572 | if (window.innerWidth > 1024) { |
13576 | 13573 | toggleSidebar(); |
@@ -13831,6 +13828,36 @@ <h2>Download Other Formats</h2> |
13831 | 13828 | } |
13832 | 13829 | } |
13833 | 13830 | }); |
| 13831 | + |
| 13832 | + // Add numeric badges for ordered lists |
| 13833 | + function injectOrderedListBadges() { |
| 13834 | + try { |
| 13835 | + const content = document.querySelector('.content-wrapper'); |
| 13836 | + if (!content) return; |
| 13837 | + |
| 13838 | + content.querySelectorAll('ol').forEach(function(ol){ |
| 13839 | + let start = parseInt(ol.getAttribute('start') || '1', 10); |
| 13840 | + if (Number.isNaN(start)) start = 1; |
| 13841 | + |
| 13842 | + Array.from(ol.children).forEach(function(li, idx){ |
| 13843 | + if (li.querySelector('.list-badge')) return; |
| 13844 | + |
| 13845 | + const badge = document.createElement('span'); |
| 13846 | + badge.className = 'list-badge'; |
| 13847 | + badge.textContent = String(start + idx); |
| 13848 | + |
| 13849 | + if (getComputedStyle(li).position === 'static') { |
| 13850 | + li.style.position = 'relative'; |
| 13851 | + } |
| 13852 | + |
| 13853 | + li.insertBefore(badge, li.firstChild); |
| 13854 | + li.style.paddingLeft = '2.2rem'; |
| 13855 | + }); |
| 13856 | + }); |
| 13857 | + } catch (err) { |
| 13858 | + console.error('Failed to inject list badges', err); |
| 13859 | + } |
| 13860 | + } |
13834 | 13861 | </script> |
13835 | 13862 | </body> |
13836 | 13863 | </html> |
0 commit comments