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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
cache/

3053
cache/gesamt-utf8.pgn vendored

File diff suppressed because it is too large Load Diff

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