From bce3b73202c40359f4ca9d28ef4fd28eebf8e590 Mon Sep 17 00:00:00 2001 From: rooklift <16438795+rooklift@users.noreply.github.com> Date: Mon, 31 Oct 2022 19:06:39 +0000 Subject: [PATCH] ignore token if it's "+" --- src/61_pgn_parse.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/61_pgn_parse.js b/src/61_pgn_parse.js index 9c6b8db9..7e6b0a80 100644 --- a/src/61_pgn_parse.js +++ b/src/61_pgn_parse.js @@ -159,14 +159,15 @@ function LoadPGNRecord(o) { // This can throw! token.reset(); // For the next round. // The above conditional means "." can only appear as the first character. + // Strings like "..." get decomposed to a series of "." tokens since each one terminates the token in front of it. if (s[0] === ".") { - s = s.slice(1); + s = s.slice(1); // s is now guaranteed not to start with "." } // Parse s. - if (s === "" || s.startsWith("$") || StringIsNumeric(s)) { + if (s === "" || s === "+" || s.startsWith("$") || StringIsNumeric(s)) { // Useless token. continue; }