open-cogsci / OpenSesame

Graphical experiment builder for the social sciences
http://osdoc.cogsci.nl/
GNU General Public License v3.0
234 stars 111 forks source link

Pasting text with a newline into a loop cell results in a corrupted experiment #768

Closed smathot closed 2 years ago

smathot commented 2 years ago

When pasting text into the cell of a loop table, the resulting script is invalid, because it includes the newline as a literal. This should be fixed at two levels. First, the loop should remove newlines from context, and also strip trailing and preceding white space. Second, syntax.create_cmd() should also remove newlines from content, and throw a warning when there are newlines, in order to prevent the script from becoming corrupted.