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

Implement all of commentary #97

Closed
mliebelt opened this issue Jun 5, 2018 · 4 comments
Closed

Implement all of commentary #97

mliebelt opened this issue Jun 5, 2018 · 4 comments

Comments

@mliebelt
Copy link
Owner

mliebelt commented Jun 5, 2018

Take the section http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm#c5 seriously. This means the following:

  • Allow the end of line comment some how.
  • Allow more than one comment at any location. So the before-, after- and moveComment should be arrays.

This will avoid hassles when importing games annotated by others. E.g. studies in lichess.org have comments by some commenters, and the will just line up.

@mliebelt mliebelt self-assigned this Jun 5, 2018
@mliebelt
Copy link
Owner Author

Currently, the parser works with a normalized PGN string, that does not contain any newline characters. Therefore, the end-of-line comment cannot work in that representation. The following should be possible:

  1. Ensure that end-of-line comments are replaced by "real" comments (started and ending with '{' and '}').
  2. Then normalize the PGN to just one line.
  3. Do the normal parsing, but allow more than one comment at any location.

This should be possible.

@mliebelt
Copy link
Owner Author

Added wiki page to have more place to think about a possible implementation (without having too much to change ...)

@mliebelt mliebelt moved this from In progress to To Do in 1.x: Grammar, Usability, NPM, Webpack ... May 21, 2020
@mliebelt
Copy link
Owner Author

The input is now more tolerant, newlines and other whitespace is allowed nearly everywhere. I had no problems in parsing the whole TWIC (> 9.000 games) without an error. So perhaps those kind of comments are not relevant any more?

@mliebelt
Copy link
Owner Author

The new version 1.2.0 of pgn-parser has fixed all of this. Issue is closed therefore.

cgencer pushed a commit to cgencer/forked_PgnViewerJS that referenced this issue Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant