Added support for one line pgn

This commit is contained in:
DHTMLGoodies
2017-03-01 19:51:08 +01:00
parent a834acb72e
commit 2b1e3e0f04
2 changed files with 7 additions and 0 deletions

View File

@@ -66,6 +66,7 @@ class PgnParser
$c = $this->pgnContent;
$c = preg_replace('/"\]\s{0,10}\[/s', "]\n[", $c);
$c = preg_replace('/"\]\s{0,10}([\.0-9])/s', "\"]\n\n$1", $c);
$c = preg_replace("/{\s{0,6}\[%emt[^\}]*?\}/","",$c);

View File

@@ -2184,6 +2184,8 @@ Rc8 Ne6+ 72. Kf6 d2 73. c5+ Kd7 0-1';
$this->assertEquals($expected["site"], $game["site"]);
$this->assertEquals($expected["black"], $game["black"]);
$moves = count($expected["moves"]);
$this->assertCount($moves, $game["moves"]);
}
}
@@ -2212,7 +2214,11 @@ Rc8 Ne6+ 72. Kf6 d2 73. c5+ Kd7 0-1';
$this->assertEquals($expected["site"], $game["site"]);
$this->assertEquals($expected["black"], $game["black"]);
$moves = count($expected["moves"]);
$this->assertCount($moves, $game["moves"]);
}
echo json_encode($games2[0]);
}
}