Skip to content

Commit f3caa9f

Browse files
committed
fix pawn drop moves in crazyhouse studies
1 parent d5b41b1 commit f3caa9f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/widgets/pgn.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,13 @@ class InlineMove extends ConsumerWidget {
12381238
: null)
12391239
: null;
12401240

1241+
// In some crazyhouse PGNs (e.g. lichess studies), pawn drops include the `P` prefix,
1242+
// but we don't want to display it in the move list.
1243+
final san = branch.sanMove.san.startsWith('P')
1244+
? branch.sanMove.san.substring(1)
1245+
: branch.sanMove.san;
12411246
final moveWithNag =
1242-
branch.sanMove.san +
1247+
san +
12431248
(branch.nags != null && params.shouldShowAnnotations
12441249
? moveAnnotationChar(branch.nags!)
12451250
: '');

0 commit comments

Comments
 (0)