Page MenuHomePhabricator

Comment parsing should be context sensitive
Open, In Progress, HighPublicBUG REPORT

Description

The PGN standard gives {, }, and ; special meaning in some but not all contexts which complicates parsing when a comment contains one of these characters. An example of the problem can be seen with the following PGN text.

<pgn>1. e4 {A comment; with a semi-colon} e5 ; A comment {and an aside} with curly braces</pgn>

In the comment after e4, the semi-colon should be parsed as a plain text semicolon because it is inside a curly brace comment. In the comment after e5, the curly braces should be parsed as plain text braces because they are in an end-of-line comment. The parser does not do this, and instead gives them their special meaning in all contexts resulting in the comments being cut-off prematurely or including text that is not part of the comment.

Related Objects

StatusSubtypeAssignedTask
In ProgressBUG REPORTWugapodes
OpenBUG REPORTNone

Event Timeline

Wugapodes renamed this task from Nested curly braces break comments to Comment parsing should be context sensitive.Apr 26 2024, 1:10 AM
Wugapodes changed the task status from Open to In Progress.
Wugapodes claimed this task.
Wugapodes triaged this task as High priority.
Wugapodes updated the task description. (Show Details)

Change #1022204 had a related patch set uploaded (by Wugapodes; author: Wugapodes):

[mediawiki/extensions/ChessBrowser@master] Context sensitive comment parsing and EOL comments

https://gerrit.wikimedia.org/r/1022204