Add cache folder to .gitignore, update pgn-parser.js
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user