+1 vote
by (2.4k points)

Hello there !

I'd like for <<case>> to not go to the line whenever I use it. 

For instance, if I do 

<<for _i to 0; i_ lt $seen.length ; _i++>>

<<switch $seen[_i]>>

<<case "There's that in seen">> Oh there's that in seen ! <<case "There's also that">> Damn, there's also that !



It will print ou something like : 

Oh there's that in seen!

Damn, there's also that! 

Whereas I'd like it to be like : "Oh there's that in seen! Damn, there's also that!" 

What could I do ? Thanks a lot !

2 Answers

0 votes
by (68.6k points)
selected by
Best answer

Have you tried wrapping the <<for>> in a <<nobr>>?

by (2.4k points)
Thanks, both of you;

<<nobr>> works indeed, but if within the for I'd like to, sometimes, have a line break, how should I do ?
by (68.6k points)

You may use a <br> tag to force a line break.

by (2.4k points)
Thanks a lot !
0 votes
by (8.6k points)

That happens because SugarCube 2, per default, adds HTML line breaks (<br> elements) whenever you have a text line break. To stop it from doing it globally (my preferred solution), add the following line to your story's JavaScript code:

Config.passages.nobr = true;

To stop it from doing it for just the one passage, add the "nobr" tag to the passage. To stop it from doing it just for a part of the passage, enclose that part in the <<nobr>>...<</nobr>> macro.