It looks like you're new here. If you want to get involved, click one of these buttons!
<<nobr>> <<if $var1 neq "">> You have a <<print $var1>> <<else>> You have nothing <</if>> <<if $var2 neq "">> and you have an ally, <<print $var2>>, with you. <<else>> . <</if>> <<endnobr>>
You have nothing .
<<nobr>> <<if $var1 neq "">> You have a <<print $var1>><<else>> You have nothing<</if>><<if $var2 neq "">>and you have an ally with you.<<else>>.<</if>> <<endnobr>>but as you can see, that's quite unsightly.
Comments
It appears that you may of found a bug in the <<nobr>> macro and I suggest you create a new issue on the SugarCube repository, remember to state which version of SugarCube you are using.
You can temporarily get around this issue by replacing the <<nobr>> macro with backslash based line-break escaping.
Also, I just tried that - Throwing a backslash at the end of each line did not seem to fix the issue. I still got the space. Perhaps it's not an issue with nobr?
It turns out that tabbing your code like such makes the program behave strangely.
It interprets the tab before the "." as a space if and only if the last printed character was not a space. (For example, if you put a space after the "You have nothing", ie: "You have nothing ", there will be exactly one space between the "nothing" and the ".", but leaving it as "You have nothing" also results in exactly one space.) How strange.
The solution was to remove all tabs AND use the backslashes. Less unsightly than having it all on one line with a nobr, but still not exactly what I would call graceful.
Unfortunately, this solution does not work for nobr - Even if you remove all tabs, you get the space.
Edit: I just installed and tested this on Sugarcube 2.6.2, and the bug is still present. I'll file an issue on the sugarcube page.
The <<nobr>> macro and nobr tag aren't one size fits all solutions, which is why the line continuation markup exists.