Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in parsing when double linebreaks between headers and movetext #42

Open
sindreij opened this issue Aug 21, 2024 · 0 comments
Open

Comments

@sindreij
Copy link

When there is a double linebreak between the headers and movetext of a pgn, it's parsed as two separate pgns, one with just headers and one with just movetext

Example

[Event "China vs World Team 2018"]
[Site "Liaocheng CHN"]
[Date "2018.04.09"]
[Round "7.4"]
[White "Shankland,S"]
[Black "Ding Liren"]
[Result "1/2-1/2"]
[WhiteElo "2671"]
[BlackElo "2778"]


1.d4 Nf6 2.c4 e6 3.Nc3 Bb4 4.e3 O-O 5.Ne2 Re8 6.a3 Bf8 7.Ng3 d5 8.Be2 b6
9.cxd5 exd5 10.O-O Bb7 11.b4 Nbd7 12.Qb3 c6 13.Bf3 a5 14.b5 c5 15.Nxd5 a4
16.Qa2 Nxd5 17.Bxd5 Bxd5 18.Qxd5 cxd4 19.exd4 Nf6 20.Qf3 Qxd4 21.Bg5 Qd5
22.Bxf6 Qxf3 23.gxf3 gxf6 24.Ne4 Re6 25.Rfc1 Ra5 26.Rc4 Rxb5 27.Rxa4 Ra5
28.Rxa5 bxa5 29.a4 f5 30.Ng3 f4 31.Nh5 Rg6+ 32.Kh1 Bd6 33.Rc1 f5 34.Rc4 Rh6
35.Rd4 Kf7 36.Nxf4 Be5 37.Rc4 Rh4 38.Nd3 Rxh2+ 39.Kg1 Bd6 40.Rd4 Rh6 41.Rd5 Ke6
42.Rxa5 Rh4 43.Kf1 h5 44.Ra8 Rh1+ 45.Ke2 h4 46.Rh8 h3 47.f4 Ra1 48.Rxh3 Rxa4
49.Rh6+ Ke7 50.Ke3 Re4+ 51.Kf3 Rd4 52.Ne5 Bxe5 53.fxe5 Re4  1/2-1/2

(this is from Ding.pgn here)

@sindreij sindreij changed the title Breaks when double linebreaks between headers and movetext Bug in parsing when double linebreaks between headers and movetext Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant