Whitespace in Harlowe causing issues

Twine Version: 3.2.12
Story Format: Harlowe 3.2.1

Hi all,
I’m working on a story for some special needs high school students. This is the first draft so a lot can still change after reviews by my colleagues. Here is what I have so far https://dgsstuff.xyz/life/ .
I’m building in multiple variables and hooks and when I add hooks to links with a bullet, they create a large amount of white space in the finished product. I’ve tried adding the \ to eliminate white space and it helps but only a certain amount.
Specifically, look at “breakfast”, and “brush teeth” to see with \ and without.

My code for breakfast is

Because you got up when your alarm went off you can eat an awesome breakfast.

Nom nom.

What's next?
(set: $breakfast to true)\
(if: $clothes is false)[* [[Get dressed]]]\
(if: $shower is false)[* [[Take a shower]]]\
(if: $teeth is false)[* [[Brush teeth]]]\
* [[I don't need to do anything else. I'm ready to go!->All set]]

Any ideas what I’m doing wrong?

I also noticed that the first page has some whitespace at the top. Is this because I have created a Startup page with all my variables?

(set: $shower to false)
(set: $teeth to false)
(set: $clothes to false)
(set: $uniform to false)
(set: $late to false)
(set: $breakfast to false)
(set: $snooze to 0)

Should I put {} around that to eliminate the whitespace?

Mark-up in general, and list mark-up specifically doesn’t like it when you interspace macro call with it, so while the following content will produce a HTML structure consisting of a single unorder list <ul> element…

* [[Get dressed]]\
* [[Take a shower]]\
* [[Brush teeth]]\
* [[I don't need to do anything else. I'm ready to go!->All set]]

…your example that incudes the (if:) macro calls will generate multiple unorder lists, one for each (if:) macro who’s condition evacuates to true, and one to contain the final list item.

In that use case I would manually add HTML <ul> and <li> elements as required. I have change your example to do this, as well as use the (unless:) macro to check if a variable current equals false.

{
	(set: $breakfast to true)
	<ul>
		(unless: $clothes)[<li>[[Get dressed]]</li>]
		(unless: $shower)[<li>[[Take a shower]]</li>]
		(unless: $teeth)[<li>[[Brush teeth]]</li>]
		<li>[[I don't need to do anything else. I'm ready to go!->All set]]</li>
	</ul>
}

note:
You shouldn’t use either is true or is false when evaluating if a Boolean variable current equals true or false. The following shows the correct techniques for doing that:

  1. check for true
(if: $variable)[The variable current equals true...]
  1. check for false
(if: not $variable)[The variable current equals false...]
or
(unless: $variable)[The variable current equals false...]
  1. handling both true and false cases
(if: $variable)[The variable current equals true...]
(else:)[The variable current equals false...]
1 Like

Who ARE you, Greyelf?! And how are you so awesome?!

I did have to change the macro for $clothes back to if:. I started with boolean conditions and then switched over to a string later in the story. I’m guessing that is a faux pas because the computer didn’t like it. I ended up using “nope” as the initial $clothes state. So now my macro looks like:

(if: $clothes is "nope")[<li>[[Get dressed]]</li>]

That seems to be working just fine.
Everything else is working great!