Add cache folder to .gitignore, update pgn-parser.js

This commit is contained in:
2026-05-24 14:27:53 +02:00
parent aec8ef9036
commit 6d588a4d5c
3 changed files with 9 additions and 3054 deletions

View File

@@ -18,7 +18,14 @@ function parsePGN(pgnText) {
function parseGameBlock(block) {
try {
const headers = {};
const headerRegex = /^\s*\[(\w+)\s+"([^"]*)"\]/g;
// Der Event-Header fehlt, weil wir danach splitten extrahiere ihn aus dem Blockanfang
const eventEnd = block.indexOf('"]');
if (eventEnd > 0) {
headers.Event = block.substring(0, eventEnd);
}
const headerRegex = /^\s*\[(\w+)\s+"([^"]*)"\]/gm;
let match;
// Extract all headers