Possibility to corrupt the buildfile with malformed html input?

I had a curious experience when editing a Menu Toolbar recently, and it seemed to have the unpleasant side-effect of doubling the size of game files after a Refresh Counters.

Use a disposable copy of a module if trying this for yourself!

To replicate the Menu Toolbar issue, take a Menu Toolbar with several entries (it’s irrelevant if those entries actually exist in the module). Above one of them insert a new Menu entry something like this:

<html>New option\

The important bits here are the opening html tag, the backslash and the lack of a terminating /html tag.

Once you confirm the change (you might have to ok the editing box and re-open it), you will notice that the menu item below this new one has disappeared. In fact, it is concatenated with the new option, and the backslash has been replaced by a comma.

Recently discussion (on the discord channel iirc), highlighted that it is not necessary to terminate html tags usually because Vassal is effectively doing that. However, this is a special case.

The error itself is easily corrected; de-merge the menu entries and use a </html> tag to terminate the one with the back-slash. However, that was not the end of the matter in my case, since Refresh Counters was now doubling the size of any files it processed. Perhaps the buildfile had been more systemically corrupted - if so it was subtle; not apparent in the editor, nor easily found by comparing files. I eventually resolved my issue by re-applying all the changes I’d done in the now corrupt module to an earlier version; strong evidence for me that the Refresh Counters issue was due to the effect of how the editor processed the backslash within the unterminated html.

I don’t know that it would be called a bug, because html should be terminated. However, it is at least a user error with a bad outcome - a very bad outcome if unnoticed buildfile corruption can indeed occur.

My proposed new feature would make the issue even less likely to arise but perhaps there is some extra parsing that the Vassal Editor could do, so to prevent the problem arising at all?