I have my own pgn parser which supports n parallel variation and nested variation.
I have written a wrapper to use chessboard.js with it.
I am facing two issues
- Removing pawn after en passant move.
- changing piece after pawn promotion.
These two issues have same common root that is to replace the piece on a particular position on board. One solution seems to provide FEN to board object and set it.
didn't find any thing in documentation. I want some other elegant solution where in I can replace a particular piece type any suggestions will be helpful.
EDIT It seems that the only way to achieve piece replacement for en passant according to example is
// for castling, en passant, pawn promotion
var onSnapEnd = function() {
board.position(game.fen());// re positioning board by providing FEN
};
Providing board.move("<en passant>")
carries out the move but does not remove the pawn which is actually ahead of the destination position.