Skip to content

Commit 8ebc881

Browse files
committed
No need to separate PGN annotations after \n
1 parent 2f72a7a commit 8ebc881

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

chess/pgn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def set_clock(self, seconds: Optional[float]) -> None:
512512
self.comment, found = CLOCK_REGEX.subn(clk, self.comment, count=1)
513513

514514
if not found and clk:
515-
if self.comment and not self.comment.endswith(" "):
515+
if self.comment and not self.comment.endswith(" ") and not self.comment.endswith("\n"):
516516
self.comment += " "
517517
self.comment += clk
518518

@@ -546,7 +546,7 @@ def set_emt(self, seconds: Optional[float]) -> None:
546546
self.comment, found = EMT_REGEX.subn(emt, self.comment, count=1)
547547

548548
if not found and emt:
549-
if self.comment and not self.comment.endswith(" "):
549+
if self.comment and not self.comment.endswith(" ") and not self.comment.endswith("\n"):
550550
self.comment += " "
551551
self.comment += emt
552552

0 commit comments

Comments
 (0)