30 lines
930 B
JavaScript
30 lines
930 B
JavaScript
// Test what's in the file
|
|
const fs = require('fs');
|
|
const content = fs.readFileSync('data/processed/pages.json', 'utf8');
|
|
const pages = JSON.parse(content);
|
|
const start = pages.find(p => p.slug === 'start' && p.locale === 'de');
|
|
const html = start.contentHtml;
|
|
|
|
// Find bg_image patterns
|
|
const matches = html.match(/bg_image=[^>]+/g);
|
|
if (matches) {
|
|
console.log('Found bg_image patterns:');
|
|
matches.slice(0, 2).forEach(m => {
|
|
console.log(' ', m.substring(0, 80));
|
|
});
|
|
}
|
|
|
|
// Check what's actually between bg_image and the number
|
|
const test = html.match(/bg_image=([^>]+)/);
|
|
if (test) {
|
|
const after = test[1];
|
|
console.log('\nAfter bg_image=:', JSON.stringify(after.substring(0, 30)));
|
|
|
|
// Check if it starts with ”
|
|
if (after.startsWith('”')) {
|
|
console.log('✓ Has ” (decimal entity)');
|
|
const id = after.substring(7, 12); // Skip ” and get 5 digits
|
|
console.log(' ID would be:', id);
|
|
}
|
|
}
|