toomasr/sgf4j

Saving SGF fails with VW node

jl1990 opened this issue · 1 comments

After loading and saving this file:

20200614-023719.zip

VW node is created like a root node. This causes the game tree to have a new node in the beginning.

According to SGF documentation, VW node is a "Miscellaneous Property" and it´s valid in any node.

The problem here is that when saving the file, this property is added with a ";" even when it´s in the header.
This causes the issue. Node ends up being added here:

rtrnNode.addProperty(key, cleanValue(value));

Yeah, writing is something that I don't use in sgf4j-gui and is under tested. I've added this prop to general properties. I need to followup with a testsuite to go over a larger set of SGF files and compare the original and read/write version.