Spaces:
Paused
Paused
File size: 1,238 Bytes
4fc5db8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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');
|