diff --git a/takhta.html b/takhta.html
index 037453f..fae0274 100644
--- a/takhta.html
+++ b/takhta.html
@@ -348,11 +348,11 @@
if (move.slice(index, index + 1) === '=') {
index++;
switch (move.slice(index, index + 1)) {
+ case 'K':
case 'Q':
case 'B':
case 'N':
case 'R':
- case 'K':
case 'P':
promotion = move.slice(index, index + 1);
break;
@@ -360,6 +360,9 @@
return {error: 'Unrecognized piece: ' + move.slice(index, index + 1)};
}
index++;
+ } else if (['K', 'Q', 'B', 'N', 'R', 'P'].includes(move.slice(index, index + 1))) {
+ promotion = move.slice(index, index + 1);
+ index++;
}
// Check(mate)