Skip to content

Commit b041698

Browse files
committed
Add detection for non-deterministic HTML patterns
1 parent 4683bcf commit b041698

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/generate-md-exports.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,20 @@ async function genMDFromHTML(source, target, {cacheDir, noCache, usedCacheFiles}
285285
console.log(`🔍 First cache miss: ${source}`);
286286
console.log(` Looking for cache key: ${cacheKey}`);
287287
console.log(` HTML length: ${leanHTML.length} chars`);
288+
289+
// Look for common non-deterministic patterns
290+
const buildHashMatch = leanHTML.match(/buildId['":]+"([^"]+)"/);
291+
const timestampMatch = leanHTML.match(/timestamp['":]+"?(\d+)"?/i);
292+
const dateMatch = leanHTML.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/);
293+
294+
console.log(
295+
` Build hash found: ${buildHashMatch ? buildHashMatch[1] : 'none'}`
296+
);
288297
console.log(
289-
` First 200 chars: ${leanHTML.substring(0, 200).replace(/\n/g, '\\n')}`
298+
` Timestamp found: ${timestampMatch ? timestampMatch[1] : 'none'}`
290299
);
300+
console.log(` Date found: ${dateMatch ? dateMatch[0] : 'none'}`);
301+
console.log(` First 500 chars: ${leanHTML.substring(0, 500)}`);
291302
}
292303
}
293304
}

0 commit comments

Comments
 (0)