I'm using Twine 1.4 with Sugarcube 2. One problem I'm having is that extraneous non-break spaces are showing up at the beginning of the line following <br> tags inside of <<nobr>> blocks.
I have a seashell collecting minigame that involves clicking up to 4 squares on a 3x3 grid to look for seashells. The contents of the grid are a randomly shuffled array of strings. When clicked, the bottom of the passage <<display>>s a passage with the same name as the corresponding string, which shows the results of that click (if you found anything, and if so, what). After 4 clicks, the game ends and all of the squares become non-clickable text, and the array containing the strings is emptied (to be repopulated on the next play). The game itself works perfectly, but there are all these extraneous spaces that I can't figure out how to get rid of. Here's the passage code:
<<nobr>>
<<if $seashellCount lt 4>>
Play the seashell game!<br>
<<for _j to 0; _j lt $seashellGame.length; _j++>>
<<print
'[ '
+ '<<if $click' + _j + ' is false>>'
+ '<<click "x">>'
+ '<<print $seashellGame[' + _j + ']>>'
+ '<<set $seashellDisplay to $seashellGame[' + _j + ']>>'
+ '<<set $seashellCount++>>'
+ '<<set $click' + _j + ' to true>>'
+ '<<script>>state.display(state.active.title, null, "back")<</script>>'
+ '<</click>>'
+ '<<else>>'
+ 'x'
+ '<</if>>'
+ ' ]'
+ '<<if _j is 2 or _j is 5 or _j is 8>>'
+ '<br>'
+ '<</if>>'
>>
<</for>>
<br>
<<if $seashellDisplay is "null">>
<<else>>
<<display $seashellDisplay>><br>
<</if>>
<<else>>
[ x ] [ x ] [ x ]
<br>
[ x ] [ x ] [ x ]
<br>
[ x ] [ x ] [ x ]
<br><br>
<<display $seashellDisplay>>
<br>
You've collected enough seashells for today. Time to head back.
<<set $seashellGame = []>>
<</if>>
<<back>>
<</nobr>>
And here are some screenshots showing the extra lines:
At the start of the game:
Once the game is finished:
Any idea how I can get rid of these spaces? I feel like I must be overlooking something pretty simple.
Comments
The space characters generated by the <<nobr>> macro shouldn't cause the issue you are having.
There are a number of passages, but they all follow the same format: