You could try the following:
(if: $inv contains ("Stick") and ("Stone"))[passage1<br>]
(if: $history contains ("KilledOgre"))[passage2<br>]
(if: $inv contains ("Apple"))[passage3<br>]
Which uses the collapsing whitespace markup to turn the hard line breaks into simple spaces. Each hook ends in a <br> element to add a line break back in where you want them.
NOTE: Be careful, the latter two (if:) macros in your example were each missing one of their parenthesis.