0 votes
by (130 points)

Hello all. I've just started using Twine, so I'm sorry if this seemingly simple question has been asked before. I tried searching the archive, but couldn't find an answer to my specific issue.

I have this passage in a bathroom:

|scurtain>[The shower curtain is drawn in front of the bathtub. You know that there's nothing behind it, but it still fills you with unease.]

(link: "Pull the shower curtain")[(replace: ?scurtain)[There is nothing behind the curtain. There never is. 

[[Inspect the bathtub|Bathtub]]]]
[[Kitchen]]

And it seems to work just fine except that I get two extra line breaks between 'check the bathtub' and 'kitchen'. I have tried \ for escaped line breaks, and {} to collapse the whitespace, but nothing seems to work, and I have no idea where those 2 extra line breaks come from or how to remove them.

Any help would be greatly appreciated.

1 Answer

+1 vote
by (159k points)

The two blank lines (line-breaks) that appear between the revealed "Inspect the bathtub" link and the existing "Kitchen" link are a result of two things:

1. The first blank line is the one that you manually placed between the line containing the "scurtain" Named Hook and the line containing the "Pull the shower curtain" link. Any contents you inject into the Named Hook will appear above that manaually added blank line.

2. The second blank line is the line where the "Pull the shower curtain" link appeared, while the link itself disappears when it is selected the line it is on does not.

The following example demostrates this effect, you will see a blank line after the link is selected.

Some text
(link: "Selected link will disappear, the line it's on wont.")[]
Some more text


There are a number of ways you can resolve your issue, the followin solution uses a combination of the (link:) macro's self replacement functionallity and Collapsing whitespace markup to force the "Inspect the bathtub" to appear where the "Pull the shower curtain" link was.

|scurtain>[The shower curtain is drawn in front of the bathtub. You know that there's nothing behind it, but it still fills you with unease.]

(link: "Pull the shower curtain")[{
	(replace: ?scurtain)[There is nothing behind the curtain. There never is.]
	[[Inspect the bathtub|Bathtub]]
}]
[[Kitchen]]

 

by (130 points)
Thank you very much for your help. That is super helpful!
...