From d0d0c71c15e741225ac35a5789c8e2b317e0c0b7 Mon Sep 17 00:00:00 2001 From: Kaj Bjorklund Date: Tue, 12 May 2015 18:31:31 +0300 Subject: [PATCH] Support dashes in move strings --- src/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.js b/src/parser.js index 7ad31a0..cd2a933 100644 --- a/src/parser.js +++ b/src/parser.js @@ -44,7 +44,7 @@ Chess.Parser.parseOneMove = function(chessPosition, text) { return legalMoves.filter(/** @param {!Chess.Move} move */function(move) { return move.getKind() === kind; }); } - var move = text.match(/([NBRQK])?([a-h])?([1-8])?([x:])?([a-h])([1-8])?(?:[=(]([NBRQ]))?/i); + var move = text.match(/([NBRQK])?([a-h])?([1-8])?-?([x:])?([a-h])([1-8])?(?:[=(]([NBRQ]))?/i); if (move) { var piece = move[1]; var fromFile = move[2];