Spaces:
Paused
Paused
Your Name
Fix router FOUC rule permanently hiding all pages; add DOM/computed-style route validators
4fc5db8 | const fs = require('fs'); | |
| const html = fs.readFileSync('hermes_overlay/tools/templates/hermes_futures_desk_luxury.html', 'utf8'); | |
| const scripts = [...html.matchAll(/<script(?![^>]*src)[^>]*>([\s\S]*?)<\/script>/g)].map(m => m[1]); | |
| console.log('script blocks:', scripts.length); | |
| let ok = true; | |
| scripts.forEach((s, i) => { | |
| try { new Function(s); } catch (e) { ok = false; console.log('SYNTAX ERROR in block', i, ':', e.message); } | |
| }); | |
| if (ok) console.log('ALL_JS_SYNTAX_OK'); | |
| const ids = [...html.matchAll(/\sid="([^"]+)"/g)].map(m => m[1]); | |
| const seen = {}; | |
| ids.forEach(id => { seen[id] = (seen[id] || 0) + 1; }); | |
| const dupes = Object.entries(seen).filter(([id, c]) => c > 1).map(([id, c]) => id + ':' + c); | |
| console.log('total ids:', ids.length, 'unique:', Object.keys(seen).length, 'dupes:', dupes.length ? dupes.join(', ') : 'none'); | |
| // naive href="#xxx" vs id="xxx" cross-check | |
| const hrefs = [...html.matchAll(/href="#([a-zA-Z0-9_-]+)"/g)].map(m => m[1]); | |
| const missing = [...new Set(hrefs)].filter(h => !seen[h] && !html.includes('data-page="' + h + '"')); | |
| console.log('hash hrefs:', [...new Set(hrefs)].join(', ')); | |
| console.log('unresolved hash refs (no matching id or data-page):', missing.length ? missing.join(', ') : 'none'); | |