Skip to content

Commit

Permalink
allow move sequences with indices (when copied from pgn)
Browse files Browse the repository at this point in the history
  • Loading branch information
eronnen committed Nov 24, 2023
1 parent adbe1a6 commit 4d61067
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/markdown/chessGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class ChessGame {
: defaultPosition(rules);

if (chessOptions.moves) {
this.sanMoves_ = chessOptions.moves.split(" ");
this.sanMoves_ = chessOptions.moves.split(/\s+/);
this.sanMoves_ = this.sanMoves_.filter((move) => !move.match(/^\d+\./)); // remove move indices
}

if (chessOptions.lastMove) {
Expand Down

0 comments on commit 4d61067

Please sign in to comment.